Recent

Author Topic: External dll static/dynamic loading  (Read 2248 times)

riwu

  • New Member
  • *
  • Posts: 15
External dll static/dynamic loading
« on: January 14, 2017, 05:32:26 pm »
I'm using some .dll files written in C++ for my application, I have a few questions regarding them:
1.
Is it possible to pack these .dll together with my application into a single .exe?

2.
For static linking, is there a way to load the dll in a folder other than the application folder?
Code: [Select]
external 'Plugins/someDLL.dll' doesn't work.

3.
When i tried to static linking some dlls, it gave an error:
Code: [Select]
The procedure entry point xxxx could not be located in the dynamic link library It works if i dynamically load the dll (with Dynlibs). What is that caused by?

4.
Is there any practical difference (performance etc) between static and dynamic linking if the dll is intended to be used throughout the lifetime of the application?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8603
  • FPC developer.
Re: External dll static/dynamic loading
« Reply #1 on: January 14, 2017, 05:39:01 pm »
1. Not using anything from FPC/Lazarus. Maybe there are external solutions
2. Not that I know. The OS does the search, and the OS manages the directories  (also from a security viewpoint)
3. This means that a symbol is missing, but is not (yet) used via the dynamic route.  Note that this assumes the dynamically loading code actually warns when it can not find a symbol (and not simply stores NIL)
4. Afaik one indirection, but this is nearly impossible to measure in current systems.

 

TinyPortal © 2005-2018