When I add require "glfw" to my nimble file, and then run nimble build, the executable won't run, it fails with the following error:
could not load: libglfw3.dylib compile with -d:nimDebugDlOpen for more information Okay fine. But I don't know what the invocation for nim actually is so I can't obey the instruction. How can I find out how nimble build is invoking nim in order to add the extra parameter to the invocation?
Alternatively, how can I get nimble to build with the extra parameter added? I tried adding switch("define", "nimDebugDlOpen") to the nimble file in accordance with the nimscript documentation, but it didn't do anything.
It seems like I have a catch-22 because nimble won't tell me what it's doing and assumes it has a handle on everything, so I can't use the compiler itself because i don't know what its doing and I can't tell nimble to do it properly because it doesn't offer this as an option (or at least it's not listed in the documentation).
how can I proceed with building the GLFW example?
Do you have glfw installed? If you use Homebrew,
brew install glfw3
may get you further.You need to install the dynamic library to use it, homebrew is indeed the easiest way.
As for passing that flag to Nim via Nimble, you can simply run nimble c -d:nimDebugDlOpen <file.nim> (or maybe even nimble build -d:nimDebugDlOpen).