I compiled the cpp file to .dll using the command:
swipl-ld -c test.cpp test.o -shared -o test test.o
When I tried to use the dll file in swi-prolog, I got this error.
Initialization goal raised exception:
‘$open_shared_object’/3: %1 is not a valid Win32 application.
The c++ code is from https://github.com/SWI-Prolog/packages-cpp. I am using the MinGW32 compiler.