Thanks for your reply. I've tried out dynlib and hit a snag. I'm writing a game.

Is it possible to link to a dependency/nim module dynamically? I'm trying to 
emulate Handmade Hero's setup. That is:

  * Call A the executable file (main)
  * Call B the dynamic library where my game-code exists
  * Call C an external dependency, specifically: sokol-nim 
(<https://github.com/floooh/sokol-nim/>)
  * A and B link against C



Now in A, I dynamically load B, using std/dynlib. The issue is: when B is 
loaded dynamically, I get a duplicate symbol error due to C being loaded 
already in A (which I believe is due to sokol-nim being static linked to both A 
and B). How can I over-ride this? I'm using nimble, but nimble seems to be 
getting in my way for this custom buildscript.

I assume with hotcode reloading this would be trivial, but considering it 
doesn't seem to be working for me on x86 (libhcr.dylib not found) and ARM (same 
error or segfault).

I have got this setup with CMake using C++. Where B and C (my third party 
dependencies) are compiled to dynamic libraries and A is simply an executable 
file.

Do you or anyone else have any recommendations? Is this possible to do with 
nimble or is there any specific compiler flags I should use here?

Reply via email to