开发者

SWI-Prolog C++ interface

I get an error while trying to load a DLL generated with swipl-ld in prolog the predicate that throws the exception is this

initialization(shlib:use_foreign_library('C:/Users/valquiria.duarte/Desktop/dlo开发者_JS百科g-server-0.3-beta-source/dlog-server/output/hash_swi.dll', install)),

and the exception is this one

ERROR: '$open_shared_object'/3: %1 is not a valid Win32 application.


According to this note at ComputerHope, Windows may report this error when the file is missing (or corrupt). It appears the filepath is fully specified in the the call to use_foreign_library, but it's worth double-checking that the path is correct about where the DLL is located.

It seems a little odd that you reported the parametric form of the ERROR message, where %1 is a placeholder for the actual filename. If that was how the error appeared on your computer, it suggests there is some failure to parse the exception details as they were thrown up the handler-chain.

If the message does contain the actual path and filename, then you should confirm their accuracy and the file's existence on the given path. It seems you have correctly called use-foreign_library using SWI-Prolog's preferred syntax of forward slashes in the filepath to separate directories. However it is the Window's operating system (more specifically the system-dependent implementation of dlopen()) that generates the error, and the resulting error message I would expect to contain a filepath and filename that contain backslashes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜