PDA

View Full Version : Problem with including lib files



metow
12th December 2009, 21:41
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:


error: undefined reference to`QwtPlotMarker::setXValue(double)'
error: undefined reference to `QwtPlotGrid::enableXmin(bool)'
... many other qwt components but the same error

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


#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_zoomer.h>
#include <qwt_legend.h>
#include <qwt_plot_marker.h>
#include <qwt_symbol.h>
#include <qwt_legend_item.h>
#include <qwt_plot_grid.h>
#include <qwt_painter.h>

interestingly intelli-sense recognize all of these variables..
anyways here is the .pro file I'm using:


TARGET = myProgramsName
CONFIG += qt thread release console
CONFIG -= flat
CONFIG -= console
QT += xml
MOC_DIR = moc
UI_DIR = UI

FORMS += allmyUIFiles

RESOURCES += source/GUI/ui.qrc

win32 {
RC_FILE = source/GUI/mcmm-gui.rc

INCLUDEPATH += d:/qt-all-opensource-src-4.4.0/qwt-5.1.1/include/

LIBS += -L"source\mcmm" -lqwt5 \

}

HEADERS += paths of all headers files..

SOURCES += paths of all my source codes..

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):


LIBS += source\mcmm\qwt5.lib

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

squidge
12th December 2009, 21:45
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.

metow
12th December 2009, 21:57
thanks I didnt know that