On Thu, 17 Jan 2013, Peter Åstrand wrote:

When building a shared library of FLTK 1.3.2 on Mac OS X 10.4 (Linux cross compilation), we get this exotic error message:

Linking CXX shared library ../lib/libfltk.dylib
/usr/lib/gcc/i686-apple-darwin8/4.5.3/../../../../i686-apple-darwin8/bin/ld:
CMakeFiles/fltk_SHARED.dir/Fl_Native_File_Chooser_MAC.mm.o literal pointer section (__OBJC,__cls_refs) does not have is exactly one relocation entry for each pointer

It turns out that this error only occurs when using -O3. Thus, one solution is to use DCMAKE_BUILD_TYPE=Debug. I decided to use this method instead:

-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-Os" 
-DCMAKE_CXX_FLAGS_RELEASE="-Os"

The problem with -O3 may very well be specific to our combination of compiler, binutils etc. We are using GCC 4.5.3.

Rgds, ---
Peter Åstrand           ThinLinc Chief Developer
Cendio AB               http://cendio.com
Teknikringen 8          http://twitter.com/ThinLinc
583 30 Linköping        http://facebook.com/ThinLinc
Phone: +46-13-214600    http://plus.google.com/112509906846170010689
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to