unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Rouben Rostamian" <rostamian@umbc.edu>
Subject: static linking
Date: Thu, 15 Jan 2004 00:50:53 -0500	[thread overview]
Message-ID: <200401150550.i0F5orkj005242@pc18.math.umbc.edu> (raw)

I am having trouble compiling and linking a C program with Guile
libraries on Linux.  I hope to get useful suggestions from you folks.

The C program is shown below in its entirety.  It is extracted from
Guile's documentation:

/* -------- try.c ------------------- */

#include <libguile.h>

static void inner_main(void *closure, int argc, char **argv)
{
	scm_shell(argc, argv);
}

int main(int argc, char **argv)
{
	scm_boot_guile(argc, argv, inner_main, 0);
	return 0;
}

/* ---------------------------------- */


Compiling this with:

   gcc try.c -lguile

produces a dynamically linked executable a.out.  It compiles
and runs just fine.

However, I wish to link against Guile's static libraries.
To that end, I do:

   gcc try.c libguile.a libguile-ltdl.a -lcrypt -ldl -lm

which also compiles successfully and produces an executable a.out.
The trouble is, a.out does not run:

   linux> ./a.out 
   Segmentation fault (core dumped)

I tried playing with various compilation flags (-static -g -O0)
unsuccessfully.

If you have hints about compiling with guile's static libraries
I would be interest to know.

System info:

   Linux kernel: 2.4.21
   gcc: 3.3.1
   guile: 1.6.4


-- 
Rouben Rostamian


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


             reply	other threads:[~2004-01-15  5:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-15  5:50 Rouben Rostamian [this message]
2004-02-06  2:23 ` static linking Rob Browning
2004-02-12 23:39   ` Marius Vollmer
  -- strict thread matches above, loose matches on Subject: below --
2004-02-06  3:55 Rouben Rostamian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401150550.i0F5orkj005242@pc18.math.umbc.edu \
    --to=rostamian@umbc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).