[The same message again - this time without the attachment - to make it work with the sorgeforge.net mail archive. For the attachment see here: http://sourceforge.net/mailarchive/attachment.php?list_name=ecls-list&message_id=CAMCvb%3DAZ4XtzpQ3kwc7qhjctNXTc5bhqWP0s4-cHVnhxXKf6AQ%40mail.gmail.com&counter=2 ]
Thanks Juanjo! This (and some adaptions) made it work on my windows host as well :)
Just for the case that it might be helpful for somebody else here my changes (I attached a tar file with the files adapted to my windows install to this email).
* Usage (cygwin, 64 bit)
In a cygwin xterm:
$ tar zxvf embed-windows.tar.gz
$ cd embed-windows
- Adapt the path of the batch file 'vcvars64.bat' in 'vsenv' to correspond to the local installation of Microsoft Visual Studio.
- Adapt the variable 'ECL_INSTALLATION_DIR' in 'Makefile' to point to the ECL installation dir.
$ chmod 755 vsenv
$ ./vsenv nmake
$ ./vsenv nmake clean
* Changes to make the example work in a cygwin windows xterm
I used cygwin to compile and execute the example.
To set the environment required by the Microsoft Visual Studio 2010 x64 tools I created the script 'vsenv'.
'vsenv' generates a batch file which loads the environment required by the Microsoft Visual Studio 2010 x64 tools via 'vcvars64.bat' and then executes the command given on the remaining part of the command line.
The location of the script 'vcvars64.bat' on my computer has been hardcoded into 'vsenv' and might have to be adapted.
Microsoft's C compiler requires that variable declarations are at top of the scope they are used in.
I therefore had to move the 'extern void init_lib_HELLO_LISP(cl_object);' declaration to the top of the 'main()' function.
I moved the lisp code to compile 'hello-lisp.lisp' into a static library into the file 'compile.lisp' as nmake has problems with the blanks in the lisp code;
I added the line to the lisp build code to switch from the default bytecodes compiler to the c compiler as mentioned in Juanjo's email;
I extracted and adapted the necessary compiler and linker options from the batch file 'ecl-config.bat'. The paths had to be adapted as they didn't correspond to the ECL installation directory.