Results 1 to 4 of 4

Thread: Qwt-based code works fine in command prompt, but not from within QtCreator

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Qwt-based code works fine in command prompt, but not from within QtCreator

    Hi all

    I´ve built a small app using Qwt with .pro file like this:

    Qt Code:
    1. QT += opengl \
    2. sql \
    3. svg \
    4. xml
    5. LIBS += c:/qwt-5.2.0/lib/qwt5.dll c:/qwt-5.2.0/lib/qwtd5.dll
    6. INCLUDEPATH += c:/qwt-5.2.0/src
    7. DEFINES += QWT_DLL
    8. CONFIG += debug_and_release
    9. TARGET = qtcreator2
    10. TEMPLATE = app
    11. SOURCES += main.cpp \
    12. mainwindow.cpp \
    13. plotterwidgetqwt.cpp
    14. HEADERS += mainwindow.h \
    15. plotterwidgetqwt.h
    16. FORMS += mainwindow.ui \
    17. plotterwidgetqwt.ui
    18. RESOURCES += mdi.qrc
    To copy to clipboard, switch view to plain text mode 

    Inside QtCreator, I guess I´ve set all properly (Qt location C:\Qt\2009.04\qt, gdb location C:\Qt\2009.04\mingw\bin\gdb.exe, etc), and the code compiles ok. In fact, from a command prompt with proper path to qwt5.dll and qwtd5.dll, both release and debug executables work fine.
    But when I run from within QtCreator (Ctrl+R), the app doesn´t start and I get:
    C:\<MyPath>qtcreator2\debug\qtcreator2.exe exited with code -1073741515
    What could be wrong???? Tks.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt-based code works fine in command prompt, but not from within QtCreator

    try copying the qwtd5.dll/qwt5.dll into your debug/release folder

  3. The following user says thank you to schnitzel for this useful post:

    maduar (27th October 2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt-based code works fine in command prompt, but not from within QtCreator

    Hi, Schnitzel! That worked.

    Now I figured out that I can also set the path to the libs, by selecting "Projects->Run Settings" and editing the PATH var, adding "C:\Qwt-5.2.0\lib", just to avoid copying the dlls to every release/debug subdir. This worked as well.

    Thanks a lot!

  5. #4
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    1

    Default QtCreator problem

    I was using MSVC++ to compile my qt codes and I decided to use QtCreator from now on
    however the problem is I can't compile my existing code in this enviroment. I also use qwt dlls in my code and I couldn't get it to work although I added the lib path just like you said to the PATH variable.
    The error I get is:

    Qt Code:
    1. error: undefined reference to`QwtPlotMarker::setXValue(double)'
    2. error: undefined reference to `QwtPlotGrid::enableXmin(bool)'
    3. ... many other qwt components but the same error
    To copy to clipboard, switch view to plain text mode 

    these errors are raising from a cpp file which includes (everything I use, and it was enough for MSVC++ enviroment ) :

    Qt Code:
    1. #include <qwt_plot.h>
    2. #include <qwt_plot_curve.h>
    3. #include <qwt_plot_zoomer.h>
    4. #include <qwt_legend.h>
    5. #include <qwt_plot_marker.h>
    6. #include <qwt_symbol.h>
    7. #include <qwt_legend_item.h>
    8. #include <qwt_plot_grid.h>
    9. #include <qwt_painter.h>
    To copy to clipboard, switch view to plain text mode 

    interestingly intelli sense recognize all of these variables.. anyways here is my .pro file:

    Qt Code:
    1. TARGET = myProgramsName
    2. CONFIG += qt thread release console
    3. CONFIG -= flat
    4. CONFIG -= console
    5. QT += xml
    6. MOC_DIR = moc
    7. UI_DIR = UI
    8.  
    9. FORMS += allmyUIFiles
    10.  
    11. RESOURCES += source/GUI/ui.qrc
    12.  
    13. win32 {
    14. RC_FILE = source/GUI/mcmm-gui.rc
    15.  
    16. INCLUDEPATH += d:/qt-all-opensource-src-4.4.0/qwt-5.1.1/include/
    17.  
    18. LIBS += -L"source\mcmm" -lqwt5 \
    19. -L"source\mcmm" -lgeneralAP \
    20. -L"source\mcmm" -naca0015CLCD
    21. }
    22.  
    23. HEADERS += paths of all headers files..
    24.  
    25. SOURCES += paths of all my source codes..
    To copy to clipboard, switch view to plain text mode 

    I guess the key thing is here the INCLUDEPATH and LIBS
    I copied qwt5.lib to my source folder thinking that giving the full path instead would be causing the problem, however didn't solve anything..

    I'm a little bit lost here, please help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.