Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl6 NativeCall cannot locate symbol in native library

I have a module using NativeCall that works on both Linux and macOS, but not Windows. When I try to use the module on Windows I get lots of errors like:

# Cannot locate symbol 'TinyTIFFReader_open' in native library 'tinytiff.dll'

I use cmake for my C++ dependency on all three OS's. On Linux and macOS I can just cmake ..; make; sudo make install, and on Windows I cmake -G "Visual Studio 15 2017 Win64" .. and then open the created ".sln" in Visual Studio to compile. The build succeeds with no errors on all three OS's.

Does anyone have any ideas of what I would need to do/change to also get my module working on Windows?

The full module is located here: https://github.com/ryn1x/Graphics-TinyTIFF

like image 502
ryn1x Avatar asked Dec 18 '18 20:12

ryn1x


1 Answers

I think you will have to give TINYTIFFREADER_LIB_EXPORT and TINYTIFFWRITER_LIB_EXPORT defines a value (either in the source, but probably better to have it be passed by the build system) and on windows i think it has to be __declspec(dllexport), otherwise the symbols may not be made available in the dll.

like image 113
timotimo Avatar answered Oct 27 '22 21:10

timotimo