When i create PlEngine pointer it crashes in gui application. But when i changed console application then this line works fine.(I'm using SWI-Prolog version 8.4.0 for x64-win64)
#include <SWI-Prolog.h>
#include <SWI-cpp.h>
int WINAPI wWinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PWSTR lpCmdLine,
int nCmdShow
)
{
////
PlEngine* m_pEngine(new PlEngine(const_cast<char*>("SomeEngine"))); //Raise a "PlError" exception because PL_initialise function returns false
////
}
int main(int argc, char *argv[])
{
////
PlEngine* m_pEngine(new PlEngine(const_cast<char*>("SomeEngine"))); //Works fine
////
}
Why swi-prolog needs to a console and how to ignore that?