[Insight-users] Missing compiler option on MacOSX

Pierre Fillard Pierre.Fillard at inria.fr
Fri May 25 15:28:00 EDT 2007


I ran into trouble when compiling a relatively big project on MacOSX.

When linking the executable, I got hundreds of errors saying:
"relocation overflow for relocation entry XXXX in section (__TEXT, ...)
(displacement too large)
all due to ITK libraries.

The solution is copied from VTK (CVS): one should add the option
"-mlong-branch" to the compiler:

IF(APPLE)
IF(NOT BUILD_SHARED_LIBS)
      SET(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -mlong-branch")
      SET(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mlong-branch")
ENDIF(NOT BUILD_SHARED_LIBS)
ENDIF(APPLE)

Once ITK is built with this option, everything compiles perfected.

I hope this was useful for the Mac users ;-)

Pierre.
PhD Candidate,
INRIA - Asclepios Team,
Sophia Antipolis, France.






More information about the Insight-users mailing list