Recent

Author Topic: how to load framework library under Mac?  (Read 6555 times)

jus

  • New Member
  • *
  • Posts: 26
how to load framework library under Mac?
« on: May 10, 2011, 05:44:00 pm »
Hi,

  I'm a Lazarus newbie and I want to us a framework/library which does not have a ".dynlib"-suffix, which is located in /library/printers/..
As I know *.dynlib files can be loaded with "loadlibrary", but in this case how can I load it and should I care about the directory?

Regards,
jus

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: how to load framework library under Mac?
« Reply #1 on: May 10, 2011, 06:44:56 pm »
Hi,

  I'm a Lazarus newbie and I want to us a framework/library which does not have a ".dynlib"-suffix, which is located in /library/printers/..
As I know *.dynlib files can be loaded with "loadlibrary", but in this case how can I load it and should I care about the directory?

What's the name of the framework? (.framework)

You can add something like this to your code to instruct the linker to add a dependency on a framework (in this case, SomeFramework.framework).

{$linkframework SomeFramework}

Alternatively, you can add switches to the Other panel of compiler options:

-k-framework -kSomeFramework

Or omit the -k and enter on the Linking panel in Pass Options to the Linker.

To see your app's framework dependencies:

otool -L myexec

Enter man ld for more information on linker switches.

Thanks.

-Phil

jus

  • New Member
  • *
  • Posts: 26
Re: how to load framework library under Mac?
« Reply #2 on: May 19, 2011, 10:35:14 pm »
Thanx Phil, but finally I gave up to use directly the external framework because of c++ class definitions.

jus

 

TinyPortal © 2005-2018