Hi,
My small project setup looks something like this:
c:/somepath/Game/game.nim c:/somepath/Game/game.nimrod.cfg c:/somepath/Game/lib/libpng16-16.dll
In game.nim I do import sdl2 import sdl2/image
image.nim contains
{.push callconv:cdecl, dynlib: LibName.} {.push importc.}
What I want it to do is when I compile it I would like game.exe to look for the libpng16-16.dll in the lib sub directory.
I tried with --clibdir:lib in the game.nimrod.cfg but get LoadBMP Error: Failed loading libpng16-16.dll: The specified module could not be found.
Im running on Windows 8.
What should I put in the cfg file to get it running.
Thanks, J
Thanks,
It didnt work, and really should have worked with the --clibdir:lib flag already as it did result in an -LPATH flag to gcc with windowsy back slashes. But I searched a bit and it seems pretty normal that the SDL_Image libs need to exist in the same folder as the executable.
To me as a beginner it makes no sense but well it runs atleast.
Thank you for answering If you have any idea how to make the run while in in the lib folder, I am all ears. :)
If you are using MSVC the lib search path (for .lib files, both dll import libraries and static libraries) are searched along the LIB path, so you would use set LIB=%LIB%;... to add to it. DLL files are loaded using the PATH. Note that the nimrod compiler does not really care where the dlls are, since it does not actually "link" to them, instead it generates code that uses stuff like LoadLibrary to load the dll and all the functions before it starts executing user code, this simplifies linking on multiple platforms and makes it eaiser to use libraries from babel. I have no idea how windows deals with search paths embedded in the executable, I would recommend you try and statically link things if you want a self-contained executable.
Again you are interested in the path and not in GCC or LD's search paths.