Hello,
I'm trying to diagnose a problem with polyc.
$ echo 'fun main() = TextIO.output(TextIO.stdOut,"Hello World");' > helloworld.sml $ polyc -o helloworld helloworld.sml Exception- SysErr ... raised
This happens regardless of the program being compiled. I took a look at what polyc is doing, and so I ended up with the following:
$ echo "use "helloworld.sml"; PolyML.export("helloworld", main);" | poly -q --error-exit $ gcc -O3 -I../libffi/include helloworld.obj -o helloworld -L/usr/local/lib -lpolymain -lpolyml -lgdi32 -lwsock32 -lstdc++ -lgcc_s -lgcc /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lpolymain /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lpolyml collect2: error: ld returned 1 exit status
I am running Windows with Cygwin. Was there a configuration I should have done that I missed? "poly" appears to work fine; the error occurs in gcc because the libraries weren't found. When I checked /usr/local/lib/ or /usr/lib/, I also could not find any libpolymain.a or libpolyml.a files. Shouldn't these have been created by the make script?
Mario
Mario,
On Sun, October 12, 2014 7:54 pm, Mario Carneiro wrote:
Hello,
I'm trying to diagnose a problem with polyc.
$ echo 'fun main() = TextIO.output(TextIO.stdOut,"Hello World");' > helloworld.sml $ polyc -o helloworld helloworld.sml Exception- SysErr ... raised
This happens regardless of the program being compiled. I took a look at what polyc is doing, and so I ended up with the following:
$ echo "use "helloworld.sml"; PolyML.export("helloworld", main);" | poly -q --error-exit $ gcc -O3 -I../libffi/include helloworld.obj -o helloworld -L/usr/local/lib -lpolymain -lpolyml -lgdi32 -lwsock32 -lstdc++ -lgcc_s -lgcc /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lpolymain /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lpolyml collect2: error: ld returned 1 exit status
I am running Windows with Cygwin. Was there a configuration I should have done that I missed? "poly" appears to work fine; the error occurs in gcc because the libraries weren't found. When I checked /usr/local/lib/ or /usr/lib/, I also could not find any libpolymain.a or libpolyml.a files. Shouldn't these have been created by the make script?
If you built and installed poly like this:
./configure make make install
then the libraries should appear in /usr/local/lib. As I needed to upgrade my Cygwin installation of poly to 5.5.2 anyway I just tried this and it worked and polyc produced a working hello world. Perhaps something went wrong when you did "make install". So I suggest you try that again and check for errors.
Aside: I find it more convenient on Cygwin to do:
./configure --prefix=/usr
so that the poly components get installed in /usr/bin /usr/lib etc. rather than /usr/local/bin etc. but it shouldn't be necessary.
Regards,
Rob.