Hi, I am trying to perform a static link, so that I can send an executable to people who do not have some libraries (Motif in this very case). I've never done that before, and adding the -static option does not work : a file onto the generated executable shows that it's dynamically linked attemp to run on a non Motif system say that shared lib libXm.so cannot be loaded Sorry to be a pain, as this is likely to be straighforward, but I'm stuck and lost. Any help will be greatly appreciated. Regards Christophe PS : can you reply also to my own email @ ? -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
* Christophe Le Cannellier (christophe.le-cannellier@wanadoo.fr) [20000401 21:38]:
I am trying to perform a static link, so that I can send an executable to people who do not have some libraries (Motif in this very case).
Please tell me the full line with which you call gcc to do the linking. Maybe you did do something wrong. Normally it should be something like gcc -static -o foo $(OBJECTS) -lX11 -lXm Make sure that libXm.a is in a place the linker can find, i.e. either passed to gcc via -L, in the environment variable LIBRARY_PATH or one of the default directories /usr/lib or /usr/local/lib. Philipp -- Philipp Thomas <pthomas@suse.de> SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany #define NINODE 50 /* number of in core inodes */ #define NPROC 30 /* max number of processes */ -- Version 7 UNIX fuer PDP 11, /usr/include/sys/param.h -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Philipp Thomas wrote:
* Christophe Le Cannellier (christophe.le-cannellier@wanadoo.fr) [20000401 21:38]:
I am trying to perform a static link, so that I can send an executable to people who do not have some libraries (Motif in this very case).
Please tell me the full line with which you call gcc to do the linking. Maybe you did do something wrong. Normally it should be something like
gcc -static -o foo $(OBJECTS) -lX11 -lXm
Make sure that libXm.a is in a place the linker can find, i.e. either passed to gcc via -L, in the environment variable LIBRARY_PATH or one of the default directories /usr/lib or /usr/local/lib.
Philipp
-- Philipp Thomas <pthomas@suse.de> SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany
#define NINODE 50 /* number of in core inodes */ #define NPROC 30 /* max number of processes */ -- Version 7 UNIX fuer PDP 11, /usr/include/sys/param.h
-- To unsubsribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Thanks for you help and concern. Here follows the output, and a small extract of the Makefile : [root@ecrehous xmpi-2.2-6.3.1]# make cd libxmpi; make make[1]: Entering directory `/root/LAM-kits/xmpi-2.2-6.3.1/libxmpi' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/LAM-kits/xmpi-2.2-6.3.1/libxmpi' hcc -static -o xmpi all_argv.o all_list.o asc_parse.o blktype.o getworkdir.o ito a.o lamtr_util.o ndi_parse.o stoi.o xmpi.o xmpi_about.o xmpi_aschema.o xmpi_asc_ parse.o xmpi_browse.o xmpi_copies.o xmpi_ctl.o xmpi_dbase.o xmpi_db_int.o xmpi_d b_parse.o xmpi_dtprint.o xmpi_dtype.o xmpi_error.o xmpi_focus.o xmpi_help.o xmpi _kiviat.o xmpi_matrix.o xmpi_misc.o xmpi_nodes.o xmpi_options.o xmpi_pophelp.o x mpi_run.o xmpi_trace.o xmpi_tr_dump.o xmpi_tr_file.o xmpi_tr_segment.o xmpi_view .o xpm.o -Llibxmpi -lxmpi -L/usr/X11R6/lib -L/usr/X11R6/lib -lSM -lICE -lXm -l Xt -lX11 -lXp -lXext -lm /usr/X11R6/lib/libXm.a(XpmRdFToI.o): In function `OpenReadFile': XpmRdFToI.o(.text+0x159): undefined reference to `_IO_stdin_' /usr/X11R6/lib/libXm.a(XpmRdFToI.o): In function `xpmDataClose': XpmRdFToI.o(.text+0x254): undefined reference to `_IO_stdin_' /usr/X11R6/lib/libXt.a(Shell.o): In function `StopManagingSession': Shell.o(.text+0x33c4): undefined reference to `SmcCloseConnection' /usr/X11R6/lib/libXt.a(Shell.o): In function `JoinSession': Shell.o(.text+0x3448): undefined reference to `SmcModifyCallbacks' Shell.o(.text+0x3454): undefined reference to `SmcClientID' Shell.o(.text+0x34ae): undefined reference to `SmcOpenConnection' Shell.o(.text+0x35c2): undefined reference to `SmcGetIceConnection' Shell.o(.text+0x35d0): undefined reference to `IceConnectionNumber' /usr/X11R6/lib/libXt.a(Shell.o): In function `SetSessionProperties': Shell.o(.text+0x3a8d): undefined reference to `SmcSetProperties' Shell.o(.text+0x3b08): undefined reference to `SmcSetProperties' Shell.o(.text+0x3b71): undefined reference to `SmcDeleteProperties' /usr/X11R6/lib/libXt.a(Shell.o): In function `GetIceEvent': Shell.o(.text+0x3ba3): undefined reference to `SmcGetIceConnection' Shell.o(.text+0x3bac): undefined reference to `IceProcessMessages' /usr/X11R6/lib/libXt.a(Shell.o): In function `CallSaveCallbacks': Shell.o(.text+0x3c45): undefined reference to `SmcSaveYourselfDone' /usr/X11R6/lib/libXt.a(Shell.o): In function `XtInteractPermission': Shell.o(.text+0x3da3): undefined reference to `SmcInteractDone' /usr/X11R6/lib/libXt.a(Shell.o): In function `XtCallCancelCallbacks': Shell.o(.text+0x3eb4): undefined reference to `SmcSaveYourselfDone' /usr/X11R6/lib/libXt.a(Shell.o): In function `XtSessionReturnToken': Shell.o(.text+0x40fe): undefined reference to `SmcInteractRequest' Shell.o(.text+0x419f): undefined reference to `SmcInteractDone' Shell.o(.text+0x41e5): undefined reference to `SmcRequestSaveYourselfPhase2' Shell.o(.text+0x420a): undefined reference to `SmcSaveYourselfDone' collect2: ld returned 1 exit status make: *** [xmpi] Error 1 ************************************************* [root@ecrehous xmpi-2.2-6.3.1]# vi Makefile [root@ecrehous xmpi-2.2-6.3.1]# make cd libxmpi; make make[1]: Entering directory `/root/LAM-kits/xmpi-2.2-6.3.1/libxmpi' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/LAM-kits/xmpi-2.2-6.3.1/libxmpi' hcc -o xmpi all_argv.o all_list.o asc_parse.o blktype.o getworkdir.o itoa.o lamtr_util.o n di_parse.o stoi.o xmpi.o xmpi_about.o xmpi_aschema.o xmpi_asc_parse.o xmpi_browse.o xmpi_c opies.o xmpi_ctl.o xmpi_dbase.o xmpi_db_int.o xmpi_db_parse.o xmpi_dtprint.o xmpi_dtype.o xmpi_error.o xmpi_focus.o xmpi_help.o xmpi_kiviat.o xmpi_matrix.o xmpi_misc.o xmpi_nodes.o xmpi_options.o xmpi_pophelp.o xmpi_run.o xmpi_trace.o xmpi_tr_dump.o xmpi_tr_file.o xmpi_ tr_segment.o xmpi_view.o xpm.o -Llibxmpi -lxmpi -L/usr/X11R6/lib -L/usr/X11R6/lib -lSM - lICE -lXm -lXt -lX11 -lXp -lXext -lm [root@ecrehous xmpi-2.2-6.3.1]# ************************************************* all: lib $(BIN) $(BIN): $(OBJ) $(CC) -o $(BIN) $(OBJ) $(LIBS) -lm lib: $(LIBXMPI) ************************************************* all: lib $(BIN) $(BIN): $(OBJ) $(CC) -static -o $(BIN) $(OBJ) $(LIBS) -lm lib: $(LIBXMPI) [root@ecrehous /root]# ************************************************* Voilà ! btw, note that the compiler is hcc, it's a C wrapper compiler for LAM/MPI implementation. The Motif I have is RedHat 2.1. Vielen danke, Christophe Le Cannellier -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
* Christophe Le Cannellier (christophe.le-cannellier@wanadoo.fr) [20000402 11:22]:
XpmRdFToI.o(.text+0x159): undefined reference to `_IO_stdin_' XpmRdFToI.o(.text+0x254): undefined reference to `_IO_stdin_'
These look like symbols from the C libraray, libc. Try putting an explicit -lc in front of -lXt.
Shell.o(.text+0x35d0): undefined reference to `IceConnectionNumber' Shell.o(.text+0x3b08): undefined reference to `SmcSetProperties' Shell.o(.text+0x3b71): undefined reference to `SmcDeleteProperties'
All the Smc* symbols come from libSM. See if you have the static version installed ( 'locate libSM.a' ).
Shell.o(.text+0x3bac): undefined reference to `IceProcessMessages'
And this comes from libICE, again, check if you have the static version installed. AFAIR, the static libs are part of the xdevel.rpm. Philipp -- Philipp Thomas <pthomas@suse.de> SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany #define NINODE 50 /* number of in core inodes */ #define NPROC 30 /* max number of processes */ -- Version 7 UNIX fuer PDP 11, /usr/include/sys/param.h -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
christophe.le-cannellier@wanadoo.fr
-
pthomas@suse.de