Re: Immediate crash upon calling PL_initialize (Win32)
Kaitain Jones <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAMeycMxaVjfExVaWVBaJQa2qZftKiAkUiaVfbN6dGkyaMNp7Fg@mail.gmail.com> |
> Ideally using a C debugger :-) That is a bit of an issue mixing gcc and > MSVC though. I don't have much experience here as I'm not faced with > this combination. We eventually got it working, but we don't fully understand what's going on. The setup seems very particular about certain things. It seems to require only two of the DLLs in the bin directory to actually run correctly: libswipl.dll libgmp-10.dll With both of these in the project's working directory, the exe will run. However, it will crash as soon as PL_initialise() is called. What we found, though, was that by moving libswipl.dll to a different directory, and adding this directory to the path (setting that in configuration properties->debugging->environment), PL_initialise() executed correctly (and everything seems to work correctly thereafter). If an additional copy of libswipl.dll was placed in the working directory, we again get a crash. The location of libgmp-10 had no effect so long as the system could find it. Pretty weird. One our guys speculated thus: "There's something in libswipl that really doesn't work properly. I suspect that it's something to do with Sfilefunctions, S__iob, and Slinesize. I do not think they are being linked properly. " We're guessing there's some Windows-level weirdness/brittleness that may be a knock-on effect of using MinGW to build the thing. Out of interest, is it possible to compile from sources purely to static libs, or is the split between the static libs and DLLs a fundamental part of how everything has been designed? KJ -------------- next part -------------- HTML attachment scrubbed and removed