Interfacing with C++ shared library that uses macros

2021-08-25 Thread Araq
I don't understand why you mix .header and .dynlib. Usually you should pick one option out of the two. When you use .header you can often get away with "importing" macros without having to rewrite them, but it's dirty and reimplementing the macro in Nim is cleaner, IMHO.

Interfacing with C++ shared library that uses macros

2021-08-22 Thread haxscramper
I have shared library that is compiled from C++ code, and want to use it from nim. I can `dynlib` import function names (using their mangled variant), but library is also defines a macro that generates calls to the functions, and when code is compiled it fails with `"undefined reference to "`. H