From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Rouben Rostamian" Newsgroups: gmane.lisp.guile.user Subject: static linking Date: Thu, 15 Jan 2004 00:50:53 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200401150550.i0F5orkj005242@pc18.math.umbc.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1074146082 32081 80.91.224.253 (15 Jan 2004 05:54:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2004 05:54:42 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jan 15 06:54:38 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ah0Sk-0001rk-00 for ; Thu, 15 Jan 2004 06:54:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ah0Q5-0002vE-Rx for guile-user@m.gmane.org; Thu, 15 Jan 2004 00:51:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ah0Oh-0002di-Ij for guile-user@gnu.org; Thu, 15 Jan 2004 00:50:27 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ah0OB-0002Io-0y for guile-user@gnu.org; Thu, 15 Jan 2004 00:50:26 -0500 Original-Received: from [130.85.145.85] (helo=pc18.math.umbc.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Ah0OA-0002Hm-1W for guile-user@gnu.org; Thu, 15 Jan 2004 00:49:54 -0500 Original-Received: from pc18.math.umbc.edu (localhost.localdomain [127.0.0.1]) by pc18.math.umbc.edu (8.12.8/8.12.8) with ESMTP id i0F5orvs005244 for ; Thu, 15 Jan 2004 00:50:53 -0500 Original-Received: (from rouben@localhost) by pc18.math.umbc.edu (8.12.8/8.12.8/Submit) id i0F5orkj005242 for guile-user@gnu.org; Thu, 15 Jan 2004 00:50:53 -0500 X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) Original-To: guile-user@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2592 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2592 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 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