From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.user Subject: Re: C module problem Date: Mon, 28 Feb 2011 06:54:04 -0800 (PST) Message-ID: <440851.45861.qm@web37908.mail.mud.yahoo.com> Reply-To: Mike Gran NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298905773 24553 80.91.229.12 (28 Feb 2011 15:09:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 15:09:33 +0000 (UTC) To: Aidan Gauland , "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Feb 28 16:09:28 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pu4j1-0003G6-LO for guile-user@m.gmane.org; Mon, 28 Feb 2011 16:09:27 +0100 Original-Received: from localhost ([127.0.0.1]:60408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pu4Wn-0004tn-99 for guile-user@m.gmane.org; Mon, 28 Feb 2011 09:56:49 -0500 Original-Received: from [140.186.70.92] (port=51692 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pu4W3-0004rb-Ph for guile-user@gnu.org; Mon, 28 Feb 2011 09:56:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pu4VJ-0003lB-Kn for guile-user@gnu.org; Mon, 28 Feb 2011 09:55:22 -0500 Original-Received: from web37908.mail.mud.yahoo.com ([209.191.91.170]:22344) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pu4VJ-0003a5-AK for guile-user@gnu.org; Mon, 28 Feb 2011 09:55:17 -0500 Original-Received: (qmail 46368 invoked by uid 60001); 28 Feb 2011 14:54:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1298904844; bh=g9QvEgI+oa4rwf9d0DAxxjrete9yU0FTCJQEy+qqNAU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=BhoWwTd+OO0gnli+bQpixbZxYEnLRi1WYPJm3TJsuRxSQcsq1IhWdBk6Jei5OYUeyMMEVoHuspMslHVBiZfN/edrDjAImPEHaXyroy0XJapfISVO5xhe80v2LBzN05EyRGoyzC0k98MjF3mkT4aKJq1EnqqlSPOwTo9qEP2IqpA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=WIOqDgz5vN9DaDvm39dSxdIjFKRGb5Ig9lnz0lqIqCZzyNIS+jmXs/Cly/GkdWvdXQT52acHaArYQ8L7lNrsPRqa2hWH1TOBFdVCTPYchHGdzWEgWQOcG4GdlVrPLyBDOrUVYid1EK5cQwJe20DxF6iFWBuV+77ioZfS5gzaNfg=; X-YMail-OSG: psJYOn8VM1k9uIszySni3Dw.CHPUxhoVqUCfyl1sjVoooX_ oGhi_ueDlIw9j3K8OMrfrrp3V2MuqHui0geCdbi4EbZhNZgdfvZZZdraD10w 8IUb1c3YfqBuBZ8e_k1t3edzHdhmPr_3EGA64fMy26Dmw.CouwFtDgaffhQh SxrEL.vQNMpRvoZyY_rYuANmYQqSIvW4RuXsAfS107gjh7pQqW2.v2jLP97Q nmcqhe7.OdmhFnA9QIMkNvYXR1RLAAIZxGSIASkpB0LuG074B7NHElIkqM5_ wSmDrfLSw1BmXMpWK3cNKIXVxzvJGJwjloPu3Mk54FbsBlCFQQOk73Ljk_RN CCg-- Original-Received: from [71.130.214.153] by web37908.mail.mud.yahoo.com via HTTP; Mon, 28 Feb 2011 06:54:04 PST X-Mailer: YahooMailWebService/0.8.109.292656 X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-Received-From: 209.191.91.170 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8471 Archived-At: > From:Aidan Gauland > 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