From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.lisp.guile.user Subject: C module problem Date: Mon, 28 Feb 2011 21:13:27 +1300 Message-ID: <20110228081326.GA25446@neko> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" X-Trace: dough.gmane.org 1298880816 15763 80.91.229.12 (28 Feb 2011 08:13:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 08:13:36 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Feb 28 09:13:31 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 1PtyEU-0007EN-MD for guile-user@m.gmane.org; Mon, 28 Feb 2011 09:13:30 +0100 Original-Received: from localhost ([127.0.0.1]:48159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PtyET-0003Yi-5y for guile-user@m.gmane.org; Mon, 28 Feb 2011 03:13:29 -0500 Original-Received: from [140.186.70.92] (port=35855 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PtyEC-0003YY-N7 for guile-user@gnu.org; Mon, 28 Feb 2011 03:13:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PtyE7-0002K2-Nx for guile-user@gnu.org; Mon, 28 Feb 2011 03:13:12 -0500 Original-Received: from jersey.rurallink.co.nz ([114.134.15.197]:52516 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PtyE7-0002Jt-5P for guile-user@gnu.org; Mon, 28 Feb 2011 03:13:07 -0500 Original-Received: from 114-134-6-192.rurallink.co.nz ([114.134.6.192] helo=localhost) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1PtyE3-0000eU-I5 for guile-user@gnu.org; Mon, 28 Feb 2011 21:13:04 +1300 Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Rurallink-Authenticated-User: aidalgol@no8wireless.co.nz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 114.134.15.197 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:8466 Archived-At: --xXmbgvnjoT4axfJE Content-Type: multipart/mixed; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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" I can follow the example in section 6.20.3 C Extensions of the manual with no trouble, so I think I am not properly linking to SDL. Can anyone help me with this? Regards, Aidan Gauland --cWoXeonUoKmBZSoM Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="sdl-guile.c" Content-Transfer-Encoding: quoted-printable #include #include "SDL.h" void init_video(); void init_module() { /* Initialize SDL. */ if (SDL_Init(SDL_INIT_VIDEO) !=3D 0) { fprintf(stderr, "SDL initialization error: %s\n", SDL_GetError()); exit(EXIT_FAILURE); } /* SDL_Quit should be called when the program finishes. */=09 atexit(SDL_Quit); /* Register guile procedures. */ scm_c_define_gsubr("init-video", 0, 0, 0, init_video); } void init_video() { /* Set up video. */ SDL_Surface *screen; screen =3D SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE); if (screen =3D=3D NULL) { fprintf(stderr, "SDL video error: %s\n", SDL_GetError()); exit(EXIT_FAILURE); } } --cWoXeonUoKmBZSoM-- --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk1rWSYACgkQjyzTRvYJmaWwkQCfV+7Vhb8ijktNHV3MXJqw7zaS 0GkAn0lzyLq5YGjQbcD1dAfc2Ja/LRuj =CaNy -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE--