C module problem

2011-02-28 Thread Aidan Gauland
Hello, I am trying to write a simple C module for Guile (for the learning experience) and I have run into a cryptic error. I have compiled `sdl-guile.c' to `sdl-guile.so' with the following command. gcc -shared -o sdl-guile.so -fPIC sdl-guile.c `guile-config compile` `sdl-config --cflags` I

Re: C module problem

2011-02-28 Thread nalaginrut
Hello, I am trying to write a simple C module for Guile (for the learning experience) and I have run into a cryptic error. I have compiled `sdl-guile.c' to `sdl-guile.so' with the following command. gcc -shared -o sdl-guile.so -fPIC sdl-guile.c `guile-config compile` `sdl-config

Re: C module problem

2011-02-28 Thread Aidan Gauland
On Mon, Feb 28, 2011 at 04:54:00PM +0800, nalaginrut wrote: I then run `guile' and evaluate (load-extension ./sdl-guile.so init_module) and get the following output. ERROR: In procedure load-extension: ERROR: In procedure dynamic-link: file: ./sdl-guile.so, message: file not found

Re: C module problem

2011-02-28 Thread nalaginrut
On Mon, Feb 28, 2011 at 04:54:00PM +0800, nalaginrut wrote: I then run `guile' and evaluate (load-extension ./sdl-guile.so init_module) and get the following output. ERROR: In procedure load-extension: ERROR: In procedure dynamic-link: file: ./sdl-guile.so, message: file

Re: C module problem

2011-02-28 Thread rm
On Mon, Feb 28, 2011 at 05:40:12PM +0800, nalaginrut wrote: On Mon, Feb 28, 2011 at 04:54:00PM +0800, nalaginrut wrote: I then run `guile' and evaluate (load-extension ./sdl-guile.so init_module) and get the following output. ERROR: In procedure load-extension: ERROR: In

Re: C module problem

2011-02-28 Thread Mike Gran
From:Aidan Gauland aidal...@no8wireless.co.nz Hello, Hi Aidan, I am trying to write a simple C module for Guile (for the learning experience) and I have run into a cryptic error. I have compiled `sdl-guile.c' to `sdl-guile.so' with the following command. gcc -shared -o sdl-guile.so

Re: C module problem

2011-02-28 Thread gustav
I am trying to write a simple C module for Guile (for the learning experience) and I have run into a cryptic error. I have compiled `sdl-guile.c' to `sdl-guile.so' with the following command. gcc -shared -o sdl-guile.so -fPIC sdl-guile.c `guile-config compile` `sdl-config --cflags`

Re: C module problem

2011-02-28 Thread dsmich
Mike Gran spk...@yahoo.com wrote: On Linux (the kernel), to see if this is the case (and I'm going from memory here, so forgive me if this isn't perfect) you can run guile as LD_DEBUG=all LD_DEBUG_OUTPUT=tmp.txt guile and then try to load your extension. Then after your run, it

Re: C module problem

2011-02-28 Thread Aidan Gauland
On Mon, Feb 28, 2011 at 12:30:31PM -0500, dsm...@roadrunner.com wrote: It is also instructive to run the command under strace -efile. You get a clear idea of what file guile *is* trying to open and *where*. I've solved more can't open the file type problems with strace than I can

Re: C module problem

2011-02-28 Thread Aidan Gauland
On Tue, Mar 01, 2011 at 07:24:51AM +1300, Aidan Gauland wrote: How do Guile bindings link to the libraries they bind? That's more or less what I am trying to do. Actually, scratch that. I just discovered Guile2's FFI. I can probably figure out how to use it by digging through the manual and

Re: C module problem

2011-02-28 Thread Andy Wingo
Hi Aidan, On Mon 28 Feb 2011 09:13, Aidan Gauland aidal...@no8wireless.co.nz writes: I am trying to write a simple C module for Guile (for the learning experience) and I have run into a cryptic error. Apologies for this. It is actually a libltdl issue: As I am sure many are aware,

Re: [r6rs] expansion bug, probably free-identifier=? related

2011-02-28 Thread Andy Wingo
Indeed, it seems free-id=? should look up the identifiers in their modules, and compare the bindings (variables), if present, for eq?-ness. Andy -- http://wingolog.org/

Re: C module problem

2011-02-28 Thread Aidan Gauland
On Mon, Feb 28, 2011 at 10:37:28PM +0100, Andy Wingo wrote: Apologies for this. It is actually a libltdl issue: As I am sure many are aware, libltdl's error reporting is pretty dumb, lt_dlerror() regularly reports things like file not found where the actual problem might be something

FFI nuisance

2011-02-28 Thread Aidan Gauland
Hi, I'm trying to use SDL through Guile's dynamic FFI. There's a slight nuisance with the procedure `dynamic-link': the name of the so file on my system (Debian squeeze) is `libSDL-1.2.so.0', so because of the `.0' at the end, (dynamic-link libSDL-1.2) fails to find the file, even if I give it