unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* static linking
@ 2004-01-15  5:50 Rouben Rostamian
  2004-02-06  2:23 ` Rob Browning
  0 siblings, 1 reply; 4+ messages in thread
From: Rouben Rostamian @ 2004-01-15  5:50 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: static linking
@ 2004-02-06  3:55 Rouben Rostamian
  0 siblings, 0 replies; 4+ messages in thread
From: Rouben Rostamian @ 2004-02-06  3:55 UTC (permalink / raw)
  Cc: guile-user

Thank you, Rob, for responding to my message regarding static linking
with libguile.  Yours is the only response I have received to that
query.  The message was posted about 20 days ago, so I had given up
hope of getting any sort of response.

You asked:

> First question -- what system are you running on and where did your
> guile libs come from?  i.e. Debian unstable, Debian stable, home
> built, some other dist, etc.

I compiled it myself from the 1.6.4 distribution.  My system's
specs were in the original message.  I will reproduce it here:

   Linux kernel: 2.4.21
   gcc: 3.3.1
   guile: 1.6.4

Additionally, the system is SuSE 9.0 and runs on glibc 2.3.2.

If you figure out how to do static linking with libguile, I would really
appreciate it if you would let me know.  In particular, since you have
cc-ed your message to guile-devel, if you get useful feedback there,
please let me know since I do not subscribe to guile-devel.

Rouben

-- 
Rouben Rostamian
v


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-12 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-15  5:50 static linking Rouben Rostamian
2004-02-06  2:23 ` 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

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).