Page 1 of 1

Linking on OS X Mountain Lion

Posted: Mon Dec 10, 2012 7:56 am
by wford
I have a large application using wxWidgets 2.9.4 (unicode, static) that compiles and links correctly on Windows. On OS X, all the C++ files compile correctly, but when linking occurs I receive the following message using any compiler. All the libraries are 64-bit.

g++ -o ./Debug/DiscreteMathCalculator @"/Users/wford/Development/A+MyPrograms/DiscreteMathCalculator/DiscreteMathCalculator.txt" -L/usr/local/lib -L. -L/usr/local/lib -lntl -lOGDF -lemon -lwx_macu_wxsf-2.9 -L/usr/local/lib -framework IOKit -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /usr/local/lib/libwx_osx_cocoau_xrc-2.9.a /usr/local/lib/libwx_osx_cocoau_webview-2.9.a /usr/local/lib/libwx_osx_cocoau_qa-2.9.a /usr/local/lib/libwx_baseu_net-2.9.a /usr/local/lib/libwx_osx_cocoau_html-2.9.a /usr/local/lib/libwx_osx_cocoau_adv-2.9.a /usr/local/lib/libwx_osx_cocoau_core-2.9.a /usr/local/lib/libwx_baseu_xml-2.9.a /usr/local/lib/libwx_baseu-2.9.a -framework WebKit -lexpat -lwxregexu-2.9 -lwxtiff-2.9 -lwxjpeg-2.9 -lwxpng-2.9 -lz -lpthread -liconv
ld: file too small for architecture x86_64
collect2: ld returned 1 exit status

Can anyone help? I have searched the Web and found nothing useful.

Thanks.

Re: Linking on OS X Mountain Lion

Posted: Mon Dec 10, 2012 10:43 am
by eranif
I would have try the following (guessing here):

1) In codeite, change the compiler name + linker name to g++ -m64 instead of plain 'g++' from settings -> build settings -> compilers -> g++ -> Tools (change both compiler name and linker name)
2) From my old mac experience, I know that g++ does not like the @ operator, so remove it from: settings -> build settings -> compilers -> g++ -> Advanced, and uncheck the option 'Pass objects to the linker via file'

Eran