Closed xslittlegrass closed 4 years ago
It seems that the inline functions defined in the header file were not exported to the library. I have moved them into the macro definition and the examples should work now.
Thanks for the fast update. It works for me now. Could you describe a little bit of the processes you use to debug this type of problem so quickly?
I normally compile the library with debug flags like -g, then attach the Wolfram kernel process to VS debugger on Windows or attach to gdb on Linux. Whatever causing the crash will trigger an interruption and tells you where it goes wrong, and you can debug from that point. In this particular case, I found that WolframLibraryData
was null, which meant the initialization function was not called, and nm showed that the function was not compiled and exported.
First of all, thanks for sharing this amazing project! This project is not only very useful in practice to ease the interaction of C++ in Mathematica, it also demonstrates greate C++ programming skills of implementing the whole system compactly.
When running in ubuntu 18.04, the sum of an array example doesn't seem to work for me. It crashes the Mathematica kernel.
This is the process I used to build and load the library in Mathematica:
I'm using gcc 7.4 on ubuntu 18.04:
g++-7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Do you have any ideas or suggestions for the potential cause? Thanks.