Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

The Carbon build and OpenGL

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

Building Lazarus on Mac OS X 10.5.2 (i386) with:

make LCL_PLATFORM=carbon OPT="-k-framework -kCarbon"

results in

Undefined symbols:
"_CGLDestroyPixelFormat", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLCreateContext", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLChoosePixelFormat", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLClearDrawable", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o _GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLDestroyContext", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o _GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLSetFullScreen", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o "_CGLSetCurrentContext", referenced from:
_GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o _GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o _GLGRAB_GRABVIAOPENGL$CGDIRECTDISPLAYID$CGRECT$$CGIMAGEREF in glgrab.o ld: symbol(s) not found
An error occurred while linking

This means that OpenGl must be linked-in (not sure if the change from previous Lazarus revisions is intentional).

Building Lazarus on Mac OS X 10.5.2 (i386) with:

make LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL"

results in

ld: cycle in dylib re-exports with /usr/X11R6/lib//libGL.dylib An error occurred while linking

The cause is a new feature (AKA bug) in /usr/bin/ld on Mac OS X 10.5, coupled with the fact that Apple rather stupidly chose the same name "libGL.dylib" for two linked but different libraries in /usr/X11/lib and in the OpenGL framework
(<http://lists.apple.com/archives/x11-users/2007/Oct/msg00146.html>)

The fix is to build Lazarus for Carbon with
(<http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug>)

make LCL_PLATFORM=carbon OPT="-k-framework -kCarbon -k-framework -kOpenGL -k-dylib_file -k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"

The build now succeeds

Regards,

Adriaan van Os

Reply by email