Results 1 to 3 of 3

Thread: Problem with including lib files

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

    Default Problem with including lib files

    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 the .pro file I'm using:

    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.  
    20. }
    21.  
    22. HEADERS += paths of all headers files..
    23.  
    24. 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've also tried (Instead of the "-L" and "-l" tags):

    Qt Code:
    1. LIBS += source\mcmm\qwt5.lib
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with including lib files

    Those arn't compiler errors, they are linker errors.

    Secondly, MSVC++ uses .lib files. QtCreator (GCC) uses .a files. Recompile qwt using GCC to get an appropriate library for QtCreator to use.

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

    metow (12th December 2009)

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

    Default Re: Problem with including lib files

    thanks I didnt know that

Similar Threads

  1. Problem in building outside source directory(loading qrc files fails)
    By Jayakrishnan in forum Installation and Deployment
    Replies: 3
    Last Post: 17th October 2009, 17:00
  2. problem in .o and moc files
    By mendes in forum Newbie
    Replies: 4
    Last Post: 28th September 2009, 16:12
  3. Replies: 5
    Last Post: 19th November 2008, 18:54
  4. Another VS problem ...
    By J-jayz-Z in forum Installation and Deployment
    Replies: 10
    Last Post: 18th October 2007, 02:12
  5. Visual Studio 2003 and .vcproj files
    By mbjerkne in forum General Discussion
    Replies: 2
    Last Post: 1st February 2006, 01:51

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.