On Tuesday, 12 January 2016 at 19:16:51 UTC, Jason Jeffory wrote:
So, I finally got it to work by abandoning demios and static linking. Derelict + dynamic linking worked with only about a min of problems(copying the proper dll to the correct place).

Every operating system has a well-defined search path for dynamic libraries. On Windows, the first location searched is the directory in which the executable resides. That's usually the simplest place to put it. When working with dub, I usually set a targetPath directive to "bin" in the configuration, so my project tree looks something like this:

- project
--bin
--source
--dub.sdl

Then I dump all of the DLLs I need in the bin directory. On other platforms, it's customary for libraries to be installed in standard system paths, but on windows all but "system" libraries (such as the Win32 libs and OpenGL) are usually shipped with the app.

Derelict allows you to specify the path to the libraries you need to load. So you can, for example, put your glfw3.dll in a subdirectory off of the bin directory, or change the name. Then you would load it, for example, like so:

DerelictGLFW3.load("dlls/glfw3_32.dll");

In this case, it doesn't matter which compiler or linker was used to build the DLL. It could have been built with GCC, VC, or DMC. The COFF/OMF issue disappears here.

Reply via email to