Sign in Join

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

Mailing lists / fpc-pascal / 2011-06

Linking to library on Mac

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Darius Blaszyk

Hi,

I'm porting an app from delphi to lazarus and now I reached a problem when trying to link to the library. The library comes with the .dynlib .a and all header files. I placed them somewhere under my homedir and added the following to my code:

{$linklib mylibrary}

I also pass the following switches to FPC (other tab on the project options in Lazarus):

-k-L/Users/dariusblaszyk/mylibraryfolder/

However I keep on getting undefined symbols. How do I "install" the library properly on Mac and how do I make FPC/Lazarus correctly aware of this lib. The lib comes with a version number, do I need to make symlinks to keep everything orderly?

Regards, Darius

Reply by email

Jonas Maebe
to Darius Blaszyk
Darius Blaszyk wrote 11 lines
I'm porting an app from delphi to lazarus and now I reached a problem when trying to link to the library. The library comes with the .dynlib .a and all header files. I placed them somewhere under my homedir and added the following to my code: {$linklib mylibrary} I also pass the following switches to FPC (other tab on the project options in Lazarus): -k-L/Users/dariusblaszyk/mylibraryfolder/

Use -Fl instead of hardcoded linker parameters (it won't solve your problem though)

However I keep on getting undefined symbols.

If the errors are at compile time, then you will have to show how you are importing the routines in the Pascal code.

If the errors are at run time, then you may want to read the following documents for information about that:
* http://qin.laya.com/tech_coding_help/dylib_linking.html
* http://doc.qt.nokia.com/qq/qq09-mac-deployment.html

How do I "install" the library properly on Mac and how do I make FPC/ Lazarus correctly aware of this lib. The lib comes with a version number, do I need to make symlinks to keep everything orderly?

Please be concrete when asking for help (this also applies to the rest of your mail): say what the actual file names are, what the exact directives are that you use in the source code, and what the exact compiler command line is you use to compile everything. Talking in generalities (especially about a platform you are not familiar with) and expecting people to figure out from that what the problem is does not work.

Jonas

Reply by email