How to correctly create a nim/nimrod windows dll

I want to create a dll from nim code.
But i failed to register some other exports than “NimMainInner”.
Even if i try this simple example its not working:

proc Hellow(): cint {.exportc.} =
  echo("hello")
  return 1

i’ve compiled it with nim c --app:lib libh4x.nim
and nim c -d:release --app:lib --no_main libh4x.nim

i use Nim Compiler Version 0.11.2 (2015-05-04) [Windows: i386]

to inspect the dll i use dllexp.exe.
I’ve also tried to load the dll with python ctypes, but none of my exports are shown or are callable. I can see the proc name in the resulting dll with an hexeditor, though.

What have i missed here?


Source: windows

Leave a Reply