RE: FFI & C++ & Cygwin

2003-01-13 Thread Simon Peyton-Jones
| It is possible to trick ghc into using cygwin's gcc in mingw-mode, | the following steps works for me to do that: Interesting. The only worry is that the run-time system and libraries are all pre-compiled with the mingw gcc. So it's not clear to me that the process Peter outlines will always

Re: FFI & C++ & Cygwin

2003-01-11 Thread Sven Panne
Just a very general remark on this topic: Mixing C and C++ is a highly delicate undertaking, see e.g. item 34 in Scott Meyer's highly recommendable "More Effective C++". The linking errors you see are probably related to initialization/shutdown of the C++ runtime system, including construction and

Re: FFI & C++ & Cygwin

2003-01-11 Thread Koen Claessen
Peter Strand wrote: | It is possible to trick ghc into using cygwin's gcc in mingw-mode, | the following steps works for me to do that: | * compile the c++-stuff with g++ -mno-cygwin | * copy /usr/bin/gcc.exe to c:/ghc/ghc-5.04.2/gcc.exe | * rename c:/ghc/ghc-5.04.2/gcc-lib to something else

Re: FFI & C++ & Cygwin

2003-01-11 Thread Peter Strand
On Fri, Jan 10, 2003 at 02:11:35PM +0100, Koen Claessen wrote: > The C++ stuff compiles fine (using Cygwin's g++). The > Haskell stuff compiles just fine (using Win Ghc). However, > at linking time I get the following error: > - undefined reference to '_impure_ptr' > - undefined reference to 'o

FFI & C++ & Cygwin

2003-01-10 Thread Koen Claessen
Dear GHC users, I have the following problem and I wonder if anyone can help. I am using the FFI to talk to a library of functions written in C++. On Unixes (Solaris, Linux) this works just fine if one adds the right -ldstdc++ here and there. However, I am using Cygwin now and that is where all