Does the latest version of Poly build on Windows if you have minw and msys to hand?
Thanks, Michael.
Michael Norrish wrote:
Does the latest version of Poly build on Windows if you have minw and msys to hand?
It should do. I haven't tested it for a while but I did update the configure script to build the native Windows version on mingw+msys.
David
David Matthews wrote:
Michael Norrish wrote:
Does the latest version of Poly build on Windows if you have minw and msys to hand?
It should do. I haven't tested it for a while but I did update the configure script to build the native Windows version on mingw+msys.
It does build, thanks. It was all very smooth. Now for my next questions though:
How do I do the linking against the shared libraries? When I do PolyML.export, I get a .obj file, but I'm not sure how to turn it into an executable. The gcc command-line that worked on Unix doesn't seem to work under Windows (even as MSYS).
How do I send the process an eof? Neither control-d nor control-z<RET> work. (I've done OS.Process.exit OS.Process.success to get out so far.)
How do I send a SIGINT equivalent? Control-C doesn't seem to do anything.
Thanks, Michael.
Michael Norrish wrote:
David Matthews wrote:
It should do. I haven't tested it for a while but I did update the configure script to build the native Windows version on mingw+msys.
It does build, thanks. It was all very smooth. Now for my next questions though:
How do I do the linking against the shared libraries? When I do PolyML.export, I get a .obj file, but I'm not sure how to turn it into an executable. The gcc command-line that worked on Unix doesn't seem to work under Windows (even as MSYS).
How do I send the process an eof? Neither control-d nor control-z<RET> work. (I've done OS.Process.exit OS.Process.success to get out so far.)
How do I send a SIGINT equivalent? Control-C doesn't seem to do anything.
This was going to be a simple reply but when I tested the CVS version of Poly/ML on mingw it crashed and it took most of yesterday to get to the bottom of the problem. It turned out that mingw's gcc was building a single-threaded version and a combination of C++ exceptions and threads would crash. I've now fixed this in the current CVS. If you want to build on the release version you may need: ./configure --prefix=/usr CFLAGS='-O3 -mthreads' CXXFLAGS='-O3 -mthreads'
The make files for Poly/ML have special code for mingw which provide the necessary options to link an ML exported object file. The following command line should work to link an object file called testme.obj : gcc -mthreads -mwindows -Wl,-u,_WinMain@16 -L/usr/lib -lpolymain \ -lpolyml testme.obj -o testme.exe This is assuming the libraries have been installed to /usr/lib using ./configure --prefix=/usr
When you build with mingw you are building the native Windows version. It will work from the command line but it is really intended to be run as a Windows application. "make install" will install poly.exe and libpolyml-1.dll into /usr/bin and you can run it just by double-clicking on poly.exe. You may also have to copy mingw10.dll into that directory from mingw/bin. When you run it this way it puts up its own Windows GUI which knows about control-D and control-C as well as having menu items for interrupt and quit. Windows does not have the concept of signals so this has to be done differently from Unix.
If you want a use the command line interface on Windows you would probably be better off with Cygwin. The Poly/ML build under Cygwin is largely the Unix version and can use Cygwin's signal mechanism. Control-C and control-D work as in Unix.
David