Hi Philip,
  I'm still having this framework issue.

When I run the otool -L <myapp> command I get
/System/Library/Carbon.framework/Versions/A/Carbon ( Compatibility version 2.0.0, current version 128.0.0) /usr/lib/libz.1.dylib ( compatibility version 1.0.0, current version 1.2.3) /usr/lib/libSystem.B.dylib ( compatibility version 1.0.0, current version 88.3.9) /usr/lib/libX11.6.dylib ( compatibility version 6.2.0, current version 6.2.0)

Does that look right?

In the lazarus compiler options under the linking tab I have
-L/Library/Frameworks/SDL.framework -framework carbon sdl

and in the Show Options screen this translates to...
-k-L/Library/Frameworks/SDL.framework -k-framework -kcarbon -ksdl

Which I think all looks fine, but I still get the following error...
/usr/bin/ld: can't open: sdl ( No such file or directory, errno = 2)
Error:Error while linking

This is definitely the location of the framework because I can create an XCode FreePascal project and that correctly links to SDL.framework in that directory and I can see a 3D OpenGL spinning cube when it runs.

Thanks,


Dominique.

Hess, Philip J wrote:
Dominique,

I don't believe that's the Carbon framework that your apps are using.

Use otool -L against any app compiled against the Carbon framework to
see the framework's location.

Try compiling with the -Cn switch, then look at the link.res text file
generated. This contains the actual switches that are being passed to
the linker.

Thanks.

-Phil


-----Original Message-----
From: Dominique Louis [mailto:[EMAIL PROTECTED] Sent: Thursday, November 01, 2007 11:29 AM
To: [email protected]
Subject: Re: [lazarus] Using SDL.framework within Lazarus project on Mac
OS X

Hi Philip,
   I've just been re-reading your message. So when using frameworks,
there is no need to specify a library name, because the linker resolves
this automagically?

just for clarification the SDL.framework is located @
/Library/Frameworks/SDL.framework.

While I notice that Carbon.framework is located @
/Developers/SDKs/MacOS10.4u.sdk/System/Library/Frameworks/Carbon.framewo
rk

I even tried adding /Library/Frameworks/ to -Fl in the Libraries field
on the Path tab in case that would help, but that did not work either. I
still get the "Can't open : sdl ( No such file or directory,  errorno =
2)".

So the compiler recognises that I'm passing a framework via the command
line, but it just can't find it. Is there something else I need to do to
use 3rd Party frameworks?

Dominique.

Hess, Philip J wrote:
Dominique,

Did you put the sdl.framework bundle (folder) somewhere that the
linker
can find it? Typically this would be in the Library/Frameworks folder.

If the linker can find the framework it should be able to find any
externally declared functions in your program. You shouldn't need any
link directives in your source either.

Note how it's done in FPCMacOSAll.pas:

function sqrt(x: double_t): double_t; external name '_sqrt';

When you include -framework carbon the linker is able to find the
"_sqrt" function in the Carbon framework's library.

Thanks.

-Phil



-----Original Message-----
From: Dominique Louis [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 30, 2007 7:53 AM
To: [email protected]
Subject: RE: [lazarus] Using SDL.framework within Lazaru project

Hi Philip,
Thanks for pointing this out. On the Mac that option was being hidden due to the dialog size, so I could not see the area where I needed to put the framework. This is now entered, but I now get a "Unable to find sdl" error message when it tris to link to the framework. Is there something else I need to do? Also, if I have sdl.pas in the project file, it complains that it cant link to -lSDL-1.2.0 .

If it finds the framework, does it still need to link to it via -l?


Thanks,


Dominique.


Quoting "Hess, Philip J" <[EMAIL PROTECTED]>:

Dominique,

On the Compiler Options tab, check the "Pass Options To The Linker"
box
and enter this in text box:  -framework sdl

This will be passed to FPC as -k'-framework' -k'sdl', which then
passes
the switches on to the linker.

Thanks.

-Phil


-----Original Message-----
From: Dominique Louis [mailto:[EMAIL PROTECTED]
Sent: Monday, October 29, 2007 9:38 AM
To: [email protected]
Subject: [lazarus] Using SDL.framework within Lazaru project

Hi all,
   What is the correct way to use an *.framework within a Lazarus
project?

I can get SDL.framework working with XCode, but don't know where put
the -kSDL line to get it to pull in the framework.

Thanks,


Dominique.


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to