Roberto,
On Tuesday 17 January 2006 11:18, Roberto Bagnara wrote:
You can also check some cross-platform tricks. "pl -x test.exe" should load mymain as long as pl is running on the native platform regardless of the platform test.exe was created on.
This is on Cygwin:
$ pl -x test.exe Welcome to SWI-Prolog (Multi-threaded, Version 5.6.2) Copyright (c) 1990-2005 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
1 ?- mymain. mymain/0 called!
Yes 2 ?-
test.exe was created on Linux?
This is on GNU/Linux:
$ pl -x test.exe Segmentation fault
This test.exe was created on Cygwin? The crash in garbageCollect() suggests there is something very wrong with the saved state sitting at the end of text.exe. There are two options. One is that saved states do not work on Cygwin and the other is that the assembly of the executable and the state (simple concatenation) is wrong. The first can be tested by writing a state using pl -o state -c file.pl and see whether you can run the result with "pl -x state" (state should run using both the Linux and the Cygwin emulator). I'm suspecting some text/binary file issue that either corrupts the state or the concatenation. Resource files are manipulated through the code in pl/src/rc. There are three implementations, one based on classical read/write, one based on Unix mmap() and one based on Windows CreateFileMapping().
Cheers --- Jan