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 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

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 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

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

RE: FFI C++

2002-10-30 Thread Simon Marlow
I am currently trying to create a Haskell interface to a C++ library and cannot get it to work completely. The problem seems to be that the linker must be able to find the code for basic C++ constructs like new and throw. Apparently it is able to do so when compiling an executable, but

RE: FFI C++

2002-10-30 Thread Seth Kurtzberg
What is the O/S and compiler? That the C++ new operator is not found is very strange. Throw is another story, as throw doesn't appear in the compiled code with some compilers. On Wed, 2002-10-30 at 04:18, Simon Marlow wrote: I am currently trying to create a Haskell interface to a C++

RE: FFI C++

2002-10-30 Thread Niklas Sörensson
On 30 Oct 2002, Seth Kurtzberg wrote: What is the O/S and compiler? That the C++ new operator is not found is very strange. Throw is another story, as throw doesn't appear in the compiled code with some compilers. We run Solaris + gcc 2.95.3. The exact error message looks like this:

Re: FFI C++

2002-10-30 Thread Wolfgang Thaller
Many platforms have the C++ runtime and the C++ standard library as a static library (probably because the C++ ABI is not as stable as it should be...). I think this applies to both Mac OS and to Windows [mingw32], perhaps it's the same with Solaris. If that is the case, it would explain the

Re: FFI C++

2002-10-30 Thread Seth Kurtzberg
Wolfgang, On Solaris, you can build GNU C++ either way; that is, to use shared libraries or linked libraries. (In fact you can also build it to enable both, and select one or the other at link time.) So, this is certainly worth checking. The easiest way to check it is to run ldd -r on the

Re: FFI C++

2002-10-29 Thread Alastair Reid
Hi, I am currently trying to create a Haskell interface to a C++ library and cannot get it to work completely. If you want to interface Hugs to C++ code, you have to link Hugs using a C++ compiler so that the Hugs binary contains new, throw, etc. I believe the main thing this changes is that

Re: HDIRECT/FFI - C enums

2001-12-30 Thread Sven Panne
Sigbjorn Finne wrote: This is just what we agreed on a couple of months ago, no? [...] What are you referring to exactly? CEnum? +//| for Enum? I can't remember any of them... Cheers, S. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED]

HDIRECT/FFI - C enums

2001-12-27 Thread Mike Thomas
Hi all. HDirect can generate code as follows: data CONST_DDWAITVBFLAGS = DDWAITVB_BLOCKBEGIN | DDWAITVB_BLOCKBEGINEVENT | DDWAITVB_BLOCKEND instance Prelude.Enum (CONST_DDWAITVBFLAGS) where fromEnum v = case v of