Recent

Author Topic: External dll/so  (Read 9944 times)

notebook

  • New Member
  • *
  • Posts: 21
External dll/so
« on: August 03, 2011, 07:59:21 am »
How I can add dll/so to  main project as reference?

in visual studio you cad add dll as reference, Can I do this in lazarus?

How I can load dll/so dynamically in main project?




jixian.yang

  • Full Member
  • ***
  • Posts: 173
Re: External dll/so
« Reply #1 on: August 03, 2011, 10:57:09 am »
In Lazarus, we can put {$MODE DELPHI} in the unit which calls the dlls, then it is the same way as in Delphi.

The demo projects for Delphi is quite easy to Google.

« Last Edit: August 03, 2011, 11:29:00 am by jixian.yang »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: External dll/so
« Reply #2 on: August 03, 2011, 11:09:50 am »
In Lazarus you don't need to add a reference to the library in the project itself, you simply add code which binds to the library.

Here is documentation about how to dynamically load a dynamic library:

http://wiki.lazarus.freepascal.org/Lazarus/FPC_Libraries#Loadlibrary_-_loading_a_dynamic_library

And about how to statically load a dynamic library:

http://wiki.lazarus.freepascal.org/Lazarus/FPC_Libraries#External_-_statically_loading_a_dynamic_library

jixian.yang

  • Full Member
  • ***
  • Posts: 173
Re: External dll/so
« Reply #3 on: August 03, 2011, 11:30:24 am »
Thanks.

 

TinyPortal © 2005-2018