Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread Stefan O'Rear
On Fri, Jun 01, 2007 at 10:48:12PM -0400, jeff p wrote: > Hello, > > >No, it sounds like you're using the wrong import syntax. > > > >That linker warning is a dead givaway you should be using ccall, not > >stdcall. > > > Ok. I just tried changing this and now things work fairly well. > I thought s

Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread jeff p
Hello, No, it sounds like you're using the wrong import syntax. That linker warning is a dead givaway you should be using ccall, not stdcall. Ok. I just tried changing this and now things work fairly well. I thought stdcall was the correct syntax for windows. This seems like a strange state

Re: [Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread Stefan O'Rear
On Fri, Jun 01, 2007 at 10:10:53PM -0400, jeff p wrote: > Hello, > > >If -fvia-C fixes your problem, then your code has a bug, strictly > >speaking. If > >your foreign call requires some information from a header file, then the > >right > >way to call it is by making a small C wrapper function

[Haskell-cafe] Re: Resolved: ffi linking problem

2007-06-01 Thread jeff p
Hello, If -fvia-C fixes your problem, then your code has a bug, strictly speaking. If your foreign call requires some information from a header file, then the right way to call it is by making a small C wrapper function and calling that. I tried to do this but couldn't. I could get GHC to com

[Haskell-cafe] Re: Resolved: ffi linking problem

2007-05-31 Thread Simon Marlow
jeff p wrote: In case anyone else finds this useful... My linking problem was finally resolved by using the -fvia-C flag when compiling with ghc. Thanks to Stefan O'Rear who pointed out the possibility and wrote: Does using -fvia-C help at all? The C compiler understands header files and i