So I decided to link the lib statically, doing the following steps:

  1. In my `nim.cfg` I added `--dynlibOverride:wren`
  2. In my source code I added this:


    
    
    when sizeof(int) == 4:
      when defined(windows):
        const wrenDynlib = "libwren-32.dll"
      elif defined(macosx):
        const wrenDynlib = "libwren-32.dylib"
      else:
        const wrenDynlib = "libwren-32.so"
    elif sizeof(int) == 8:
      when defined(windows):
        const wrenDynlib = "libwren-64.dll"
      elif defined(macosx):
        const wrenDynlib = "libwren-64.dylib"
      else:
        const wrenDynlib = "libwren-64.so"
    {.link: currentSourcePath.splitPath.head / wrenDynlib .}
    
    
    Run

There's probably a cleaner way btw, but I did this for testing.

ld doesn't return any errors, but my application itself does: 
    
    
    /home/[user]/Coding/Nim/rapid/src/rapid: error while loading shared 
libraries: libwren.so: cannot open shared object file: No such file or directory
    Error: execution of an external program failed: 
'/home/[user]/Coding/Nim/rapid/src/rapid '
    
    
    Run

Reply via email to