You missed my Birthday again!
Hi ya, Can't believe you missed my Birthday again, give me a call when you get this e-mail. You have to check out this great present Mel sent me, everyone at work is going mad over it! www.deals2go.co.uk/script Ami ___ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi
[Fwd: Re: Foreign import]
I have continued reading the bibliography on ffi but I cannot find the solution. Please, can anyone help me?. gustavo Original Message Subject: Re: Foreign import From: Gustavo Villavicencio [EMAIL PROTECTED] Date: Tue, March 4, 2003 8:35 pm To: [EMAIL PROTECTED] Thanks Manuel The error message is as follows -- CallIncr.o: In function `sWM_entry': CallIncr.o:(.text+0xc5): undefined reference to `incr' collect2: ld returned 1 exit status -- where 'incr' is a toy function defined in 'mylib.h'. Obviously, in the foreign declaration I have changed 'myfun' by 'incr'. The compilation command is the typical ghc -ffi -c CallIncr.hs followed by ghc -ffi CallIncr.o which generate the previous error. Thanks again, gustavo Manuel M T Chakravarty said: Gustavo Villavicencio [EMAIL PROTECTED] wrote, I'm a new ffi user and I have some problems with foreign import declaration. I'm don't have any problem to access C standard functions. However, I cannot access to my own functions in mylib.h by means of foreign import mylib.h myfun hmyfun :: ... May be I'm omitting some compilation step or parameter also, since I'm applying the same compilation process to call C standard functions. I'm working with ghc 5.04 on SuSe Linux 7.0. You should say what goes wrong. Eg, paste the error messages of the compiler and/or linker into your email. Manuel ___ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi
Re: Comparing [Fun]Ptrs
Volker Stolz [EMAIL PROTECTED] wrote, Hi, I'm looking for a way of comparing Ptrs to null *elegantly*. The FFI distinguishes between 'Ptr a' and 'FunPtr a', so testing would mean writing ((==) null[Fun]Ptr). This is rather tedious and a predicate 'isNull' might be in order so that it's possible to write when (isNull p) $ ... or throwIOErrorIf isNull ... , especially without having to worry about comparing against the correct null pointer (FunPtr or Ptr). That's something where a class can help, but I'm not sure whether such a specialised class is desired... An isNullPtr was proposed before and rejected; see the corresponding thread in the archive of this list. Mainly on the grounds that people didn't consider ((==) null[Fun]Ptr) to be tedious to write. Besides, I really don't want to make any changes for version 1.0 of the spec anymore; except finish up the finalizer/Foreign{Ptr,Proxy} story. Further convenience functions can go into extra libraries (there is no need to stick them all in the base spec). Cheers, Manuel ___ FFI mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/ffi