finding *.DLL in another folder lazarus / 11-Options ---------------------------------------------------------------------- marmin · 2008-06-14 08:23 I have a DLL file in a separate folder and I want the compiler to find it. I have specified the folder in compiler settings / libraries. Still, the DLL is not found. What am I doing wrong? ---------------------------------------------------------------------- Phil · 2008-06-14 14:34 Quote from: "marmin"I have a DLL file in a separate folder and I want the compiler to find it. I have specified the folder in compiler settings / libraries. Still, the DLL is not found. What am I doing wrong? Do you mean you want the DLL to be found at runtime? With Windows the DLL needs to be on the path. Not sure what you mean by having the *compiler* find it. Thanks. -Phil ---------------------------------------------------------------------- marmin · 2008-06-15 11:30 Quote from: "Phil" Do you mean you want the DLL to be found at runtime? With Windows the DLL needs to be on the path. -Phil How can I set the path to another directory then. I have the .DLL is a folder called Lib. (in de main dir). ---------------------------------------------------------------------- Legolas · 2008-06-15 13:54 If you are on windows there is the SetEnvironmentVariable function that should do the trick. ---------------------------------------------------------------------- duncanparsons · 2008-06-16 14:00 either that, or dynaically load it, using LoadLibrary('\FOLDERNAME\FILE.dll') - assuming that the current directory is the where the application is; to be certain you could get the app path and use that. It would be more longwinded to do that, but you can have a better chance of things working. Have a unit dedicated to the dll, and in the initialisation, try the load library and if it succeeds marry up the imports and set a flag saying you have the dll. If it can'r be found, or is a wrong version, you can show an error, or just silently set a flag and not show the relevant options in the main app. HTH DSP