I'm writing a project in VS 2017 that utilizes the Windows 32 bit version of SWI Prolog. I'm using the SWI Prolog C++ interface in another project that compiles with MSVC, using a C++ header and a .a static library to go with it.
I got everything linked together fine so that the projects runs okay in the local debugger mode for VS. However, when I try to use the compiled .exe, I get a linker error:
The procedure entry point __divmoddi4 could not be located in the dynamic link library C:\ProgrammingLanguages\swipl-32\bin\libswipl.dll
After some Googling I saw that this function is unique to newer versions of GCC, and it makes sense that the SWI Prolog library uses it considering it was cross compiled using MinGW.
The problem is I need this executable to work on its own, but I have no idea how to get the project to resolve this linker error without straight up switching to GCC. Is there any way I can resolve this linking error while still using MSVC?
I read some other threads about using extern "C"
to resolve the problem but I get compiler errors since there's overloaded functions in the header I'm using. Unless I need to use the C header for SWI Prolog instead?