SWI-Prolog / contrib-swiplcs

Interface from C# to SWI-Prolog
http://www.lesta.de/Prolog/SwiPlCs/Generated/Index.html
24 stars 10 forks source link

Attempted to read or write protected memory. #6

Closed lunamrcc closed 5 years ago

lunamrcc commented 5 years ago

Hello,

I have the following error:

System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

I've seen many of the forums and many answers but I can't make it work... (Changing the name of the SwiPlCs64 to SwiPlCs dll, using SWI_HOME_DIR...)

This is my configuration: SWI-Prolog (threaded, 32 bits, version 7.6.4) SwiPlCs 1.1.60605.0 Visual Studio 17 15.7.5 .Net Framework 4.7.03056 Windows 10

lunamrcc commented 5 years ago

I figure it out: The lastest version of SWI-Prolog don't work with SwiPlCs. I install SWI-Prolog 6.6.1 (32 bits) and It works fine.

MateuszChilinski commented 5 years ago

Hey guys,

I've really struggled with problems with this packet, yet after hours of trying I figured out how to get it running on Win10 & newest Visual Studio, the complete guide to fixing the issue of this thread and also "The specified module could not be found. (Exception from HRESULT: 0x8007007E)" errors:

Then it will start to work. @UweLesta it would be nice if you included it in readme but I don't know how active you are :) Thought great work with the project!

I'm pretty much writing it so it indexes on google and it will be easier to use for others who wish to use prolog in C# :)

JanWielemaker commented 5 years ago

This package is old. It probably doesn't need much work as the C API of SWI-Prolog is pretty stable. There have been a couple of versions that introduced binary incompatibility. Recompiling should fix that. Also the name of the SWI-Prolog dll has changed a couple of times, as well as its dependencies.