| Linker parameters [message #518438] |
Thu, 04 March 2010 01:29  |
Alex Farber Messages: 44 Registered: February 2010 |
Member |
|
|
I have wxWidget application which contains this code:
http://wiki.wxwidgets.org/Compiling_and_getting_started
Compiling it from the command line:
alex@alex-linux:~/Tmp$ g++ `wx-config --cppflags` `wx-config --libs` widgetTest.cpp
/tmp/ccMcZC6J.o: In function `wxCreateApp()':
widgetTest.cpp:(.text+0x2d): undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
...
widgetTest.cpp:(.text._ZN20wxThreadHelperThreadD0Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x16): undefined reference to `wxThread::~wxThread()'
collect2: ld returned 1 exit status
A lot of linker errors. Now, if I change command line, moving linker flags to the end, build succeeds:
g++ `wx-config --cppflags` widgetTest.cpp `wx-config --libs`
When I build the same code from Eclipse CDT, in the Project Settings, GCC C++ Compiler, I add these flags: `wx-config --cppflags`. For linker I add these flags: `wx-config --libs`. Result is linker errors, as in the first command line.
How can I reproduce the second command line solution in the CDT project? If exist working command line, it must be some way to do the same in CDT.
[Updated on: Thu, 04 March 2010 01:30] Report message to a moderator
|
|
|