[CMake] Error in linking

Steven Van Ingelgem steven at vaningelgem.be
Thu Nov 6 06:23:52 EST 2008


Hi all,


I finally got my application to compile under Mac OSX, but now I am beating
the wall again in the linking procedure.

Could someone tell me what is wrong in this line (cmake generated):

/usr/bin/c++     -O2  -D__WXOSX_CARBON__ -O -g -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
 -mmacosx-version-min=10.4 -Wl,-search_paths_first
-headerpad_max_install_names -fPIC *<<A BUNCH OF .o FILES>>*  -o
bin/SS.app/Contents/MacOS/SS  -arch ppc -arch i386 -framework QuickTime
-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox
-framework System -framework OpenGL /usr/lib/libwx_osx_carbonu_adv-2.9.a
/usr/lib/libwx_osx_carbonu_core-2.9.a /usr/lib/libwx_base_carbonu-2.9.a
/usr/lib/libwx_osx_carbonu_gl-2.9.a /usr/lib/libwx_base_carbonu_xml-2.9.a
-framework WebKit -lwxregexu-2.9 -lwxexpat-2.9 -lwxtiff-2.9 -lwxjpeg-2.9
-lwxpng-2.9 -lwxzlib-2.9 -lpthread -liconv -framework OpenGL -framework AGL
-framework AGL -framework OpenGL bin/libftgl.a bin/libfreetype2.a
/usr/lib/libwx_osx_carbonu_adv-2.9.a /usr/lib/libwx_osx_carbonu_core-2.9.a
/usr/lib/libwx_base_carbonu-2.9.a /usr/lib/libwx_osx_carbonu_gl-2.9.a
/usr/lib/libwx_base_carbonu_xml-2.9.a -framework WebKit -lwxregexu-2.9
-lwxexpat-2.9 -lwxtiff-2.9 -lwxjpeg-2.9 -lwxpng-2.9 -lwxzlib-2.9 -lpthread
-liconv -framework AGL -framework AGL -framework OpenGL

The error it reports is:
ld: library not found for -lwxregexu-2.9
collect2: ld returned 1 exit status

This is correct because libwxregexu-2.9.dylib doesn't exist... Only the ".a"
version... Which is what I want to use to compile it in.

I read something that it's not possible to static compile, but it does work
with the other libraries, just not with the ones given as a "-l" parameter.
This is turn is reported by the wx-config utitilty:

*wx-config --static=yes --debug=no --libs*

 -arch ppc -arch i386  -framework QuickTime -framework IOKit -framework
Carbon -framework Cocoa -framework AudioToolbox -framework System -framework
OpenGL  /usr/lib/libwx_osx_carbonu_xrc-2.9.a
/usr/lib/libwx_osx_carbonu_html-2.9.a /usr/lib/libwx_osx_carbonu_qa-2.9.a
/usr/lib/libwx_osx_carbonu_adv-2.9.a /usr/lib/libwx_osx_carbonu_core-2.9.a
/usr/lib/libwx_base_carbonu_xml-2.9.a /usr/lib/libwx_base_carbonu_net-2.9.a
/usr/lib/libwx_base_carbonu-2.9.a -framework WebKit -lwxregexu-2.9
-lwxexpat-2.9 -lwxtiff-2.9 -lwxjpeg-2.9 -lwxpng-2.9 -lwxzlib-2.9 -lpthread
-liconv

What flag can I use to let the linker know I want the static compiled
libraries of wx instead of the (non-existant) dynamic ones?


Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081106/f689ccc4/attachment.htm>


More information about the CMake mailing list