Recent

Author Topic: 10.5.2 + Carbon Laz - 'Error whilst linking'  (Read 5808 times)

chillibear

  • Newbie
  • Posts: 3
10.5.2 + Carbon Laz - 'Error whilst linking'
« on: March 27, 2008, 12:23:34 am »
Hello,

Quick question.  Managed to get the carbon version of Laz (from svn) working on my mac (10.5.2 intel powerbook) as per Carbon Interface.

However when I attempt to build/run anything I get a linking error without any clear indication as to quite what is failing to link.  I'm hoping it's the same problem mentioned in this thread: MacOS 10.5 + svn = Error while linking

However being rather new to Laz (long time Delphi lad) I couldn't see anywhere obvious in the IDE to set any additional linking options as mentioned in that thread.  Am I just being a bit blind or is it buried somewhere?  Could anyone point me in the right direction to add those options to see if it solves my problem, or suggest any other solutions.

Thanks

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: 10.5.2 + Carbon Laz - 'Error whilst linking'
« Reply #1 on: March 27, 2008, 02:07:03 am »
Quote from: "chillibear"
However being rather new to Laz (long time Delphi lad) I couldn't see anywhere obvious in the IDE to set any additional linking options as mentioned in that thread.  Am I just being a bit blind or is it buried somewhere?  Could anyone point me in the right direction to add those options to see if it solves my problem, or suggest any other solutions.


I'm still running 10.4 so I don't have that problem, but I see this posting:

http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&t=5143

The fpc.cfg file is in /private/etc.

If you don't want to modify fpc.cfg, you can enter it in Options on the Linking tab of Compiler options. Don't enter the "-k" since the IDE will add this automatically. And be sure to check the Add Options box.

I believe this additional linking switch is needed to work around a problem with the Apple linker. There was a link somewhere to an Apple Web page that explained what the issue was.

I imagine that eventually this switch will be added automatically by the IDE the way the -framework Carbon and -framework OpenGL switches are.

Thanks.

-Phil

chillibear

  • Newbie
  • Posts: 3
10.5.2 + Carbon Laz - 'Error whilst linking'
« Reply #2 on: March 28, 2008, 01:03:13 pm »
Thanks Phil,

Managed to get things linking by adding the:

Code: [Select]
-dylib_file' '/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'


linking option under: Project->Compiler Options->Linking Tab  as suggested.

Not quite sure why I need the path to the OpenGL libs in twice, but it didn't seem to work with it in just once.  So that's my carbon applications building okay... now to try to get the things actually running!

Phil

  • Hero Member
  • *****
  • Posts: 2737
10.5.2 + Carbon Laz - 'Error whilst linking'
« Reply #3 on: March 28, 2008, 05:28:50 pm »
Quote from: "chillibear"
Thanks Phil,

Managed to get things linking by adding the:

Code: [Select]
-dylib_file' '/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib'


linking option under: Project->Compiler Options->Linking Tab  as suggested.

Not quite sure why I need the path to the OpenGL libs in twice, but it didn't seem to work with it in just once.  So that's my carbon applications building okay... now to try to get the things actually running!


Here's the technical explanation:

http://developer.apple.com/qa/qa2007/qa1567.html

Thanks.

-Phil

 

TinyPortal © 2005-2018