Re: Help with nlffi
Natalia Beatriz Bidart <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
Brian (and smlnj-list), brian wrote: > I highly recommend you use the math example which is in the sml source > tree. > It's a very good example to start with. This is just great! An example is just what I was needing, and I've only checked the $SMLNJ_HOME/src/ml-nlffigen directory... silly me :-). I've just found explanatory examples on $SMLNJ_HOME/src/ml-nlffi-lib/Tests. > To access your "something" you just need to do : > > F_something.f() > > I also recommend compiling foo.c to a dynamic library and use dynamic > loading. Dynamic loading is really the best way to take advantage of > nlffi. > > A simple example should not be too many files, you could just post the > source code for more help. Thanks a lot for answering. One thing to note is that I was getting this error when loading the foo.cm file: [scanning $/c.cm] foo.cm:4.13-5.6 Error: Io: openIn failed on "$Undef<c.cm>/c.cm", No such file or directory and I knew that the c.cm wasn't being loaded but I didn't know how to fix that. Thing is that the README file shows as .cm-file example the following: +------------------------------------------------------------- |library | library(FFI/foo.cm) |is | $/basis.cm | $/c.cm | FFI/foo.cm : make (-f foo.make) +------------------------------------------------------------- and I've just seen that the math example uses "$c/c.cm" instead of "$/c.cm". I'll make the necessary changes and I'll start over. Best regards, Natalia. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642