guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C module problem


From: Mike Gran
Subject: Re: C module problem
Date: Mon, 28 Feb 2011 06:54:04 -0800 (PST)

> From:Aidan Gauland <address@hidden>


> 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 -fPIC sdl-guile.c `guile-config compile` 
> `sdl-config 
> --cflags`
> 
> 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"

If you are getting this error when you've done everything right
with paths and filenames, it may indicate that the file is being
found, but, that there are some other error errors that keep it
from being loaded.

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 should have made a handful of tmp.txt files, one
per thread.  Search through these files for strings like "error" or "fatal"
with reference to your binding.  It may be that you've misspelled a function
name or are trying to link to a function that doesn't exist.

For more info on this, check out the man page to ld-linux.so

Hope this helps,

-Mike Gran



reply via email to

[Prev in Thread] Current Thread [Next in Thread]