Archived

This topic is now archived and is closed to further replies.

Distributing with DLLs

This topic is 4982 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I want to distribute Binary versions of a program and don''t know how I can add the path to runtime libraries to the project. It only works (compiling and running it) if the DLLs are in the same directory as the exe file. I want to put them in a subfolder though. I use Dev-C++ but I think a general answer would help. Where do I have to look / what do I have to change?

Share this post


Link to post
Share on other sites
This is a bit fo a guess but I think you might be able to do it via dynamic linking and LoadLibrary() - something like LoadLibrary("SubFolder/MyDll.dll"), not sure if it''s possible via static linking.

Share this post


Link to post
Share on other sites
I think I don''t understand compilers well enough.
Maybe because the main function is handled by SDL it is not possible to use LoadLibrary?

I can compile the program but it doesn''t make a difference.
(SDL.dll was not found)

Guess I''ll have to put them into the root directory :/

---
Tolop|Andyart.de

Share this post


Link to post
Share on other sites
If I remember right, without LoadLibrary(), Windows looks first in the directory where the exe is, then in the Windows directory, then in the Windows/System (or System32) directory, then searches your PATH variable.

If you want it to reside someplace else, you have to use LoadLibrary(). But, with SDL, that probably isn''t an option.

Share this post


Link to post
Share on other sites
quote:
Original post by Ranger50000
You guys are over complicating this. ("SubFolder/MyDll.dll"), is wrong haven''t you ever referenced a file by name in c++? It should be ("subfolder\\mydll.dll"). Its always double backslashes, and making all of your files lower case is smart too.


Actually, Windows handles forward slashes just fine. And on Win2K/WinNT/WinXP, upper-case, lower-case, and mixed-case filenames map to the same name.

Share this post


Link to post
Share on other sites
quote:
Original post by Dave Hunt
quote:
Original post by Ranger50000
You guys are over complicating this. ("SubFolder/MyDll.dll"), is wrong haven''t you ever referenced a file by name in c++? It should be ("subfolder\\mydll.dll"). Its always double backslashes, and making all of your files lower case is smart too.


Actually, Windows handles forward slashes just fine. And on Win2K/WinNT/WinXP, upper-case, lower-case, and mixed-case filenames map to the same name.


Actually, that worked on all Windows versions out there(At least 95+). And using / is much better, because if you want to develop crossplatform Linux hates \\.

Toolmaker



My site
/* -Earth is 98% full. Please delete anybody you can.*/

Share this post


Link to post
Share on other sites