开发者

QMake and wxWidgets (External Libraries)

I'm trying to compile a GUI program based on the wxWidgets libraries. I get a lot of undefined references to "something". I tried to add a few libraries manually on the LIBS variable of QMake without success. How can i add all the wxWidgets libraries to QMake without hard coding each library? Below is my .pro file.

# simple.pro
TARGET = sample

HEADERS += main.h simple.h
SOURCES += main.cpp simple.cpp

LIBS += -LC:/SourceCode/Libraries/wxWidgets2.8/lib/gcc_dll/wxmsw28_core_gcc.dll \
        -LC:/SourceCode/Libraries/wxWidgets2.8/lib/gcc_dll/wxmsw28_gcc.dll \
        -LC:/SourceCode/Libraries/wxWidgets2.8/lib/gcc_dll/wxmsw28_aui_gcc.dll

INCLUDEPATH += C:/SourceCode/Libraries/wxWidgets2.8/include

CONFIG += release

The errors are of the form:

release/simple.o:simple.cpp:(.rdata$_ZTV6Simple[vtable for Simple]+0x320): undefined reference to `wxFrameBase::Set开发者_运维技巧StatusBar(wxStatusBar*)'


First, you need to use the .a files to add to the linker.

Then you need to define WXUSINGDLL if you link against the shared libraries.

Additionally, you forgot

 wxbase29u.a

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜