making statically-linked executable

making statically-linked executable

Post by Michael Torri » Tue, 21 Sep 1999 04:00:00



I'm trying to make a statically-linked program that uses GTK+.  It seems
that my GTK libraries are all shared libraries, so when I do a GCC
-static, all the GTK functions come up as missing symbols.  How do I get
a static executable out of the thing?  Is there a way of getting a
static exe out of shared libraries, or do I have to have static versions
of the libraries as well?  If so, is there a utility to convert a shared
library to a static one?

Thanks
Michael
caseih at hotmail dot com

 
 
 

making statically-linked executable

Post by Tom Leet » Tue, 21 Sep 1999 04:00:00



> I'm trying to make a statically-linked program that uses GTK+.  It seems
> that my GTK libraries are all shared libraries, so when I do a GCC
> -static, all the GTK functions come up as missing symbols.  How do I get
> a static executable out of the thing?  Is there a way of getting a
> static exe out of shared libraries, or do I have to have static versions
> of the libraries as well?  If so, is there a utility to convert a shared
> library to a static one?

If you use RPMs, install the glib-devel gtk+-devel packages.

If tarballs, do:
$ ./configure --help
to discover the magic words for the build. It's usually
'--enable-static'.

Tom

 
 
 

making statically-linked executable

Post by Michael Torri » Wed, 22 Sep 1999 04:00:00


When I build libraries, I always get a .so file, which is a shared library,
and a .a file, which I believe is generated by ar, and is simply an archive
of the .o files, is that right?  Anyway, I'm just trying to understand
libraries and library creation.

Michael
caseih at hotmail dot com



> > I'm trying to make a statically-linked program that uses GTK+.  It seems
> > that my GTK libraries are all shared libraries, so when I do a GCC
> > -static, all the GTK functions come up as missing symbols.  How do I get
> > a static executable out of the thing?  Is there a way of getting a
> > static exe out of shared libraries, or do I have to have static versions
> > of the libraries as well?  If so, is there a utility to convert a shared
> > library to a static one?

> If you use RPMs, install the glib-devel gtk+-devel packages.

> If tarballs, do:
> $ ./configure --help
> to discover the magic words for the build. It's usually
> '--enable-static'.

> Tom

 
 
 

making statically-linked executable

Post by Elmo Reci » Wed, 22 Sep 1999 04:00:00



> When I build libraries, I always get a .so file, which is a shared library,
> and a .a file, which I believe is generated by ar, and is simply an archive
> of the .o files, is that right?  Anyway, I'm just trying to understand
> libraries and library creation.

.a files are the static libraries you need.

Elmo Recio
Homepage: http://polywog.navpoint.com/~elmo
Sociology/Philosophy student at Drexel Univ

"Hilary went to her death
 because she couldnt think of anything to say
 Everybody thought that she was boring
 So they never listened anyway.
 Nobody was really saying anything of interest
 She fell asleep."
-Belle And Sebastian (If You're Feeling Sinister)

 
 
 

1. Make statically-linked executable from dynamic, with no source ?

Is there a utility that will let me take dynamically-linked system
utilities for which I have no source (such as sed and grep) and create
statically-linked versions? (Solaris 2.5.1)

The reason for this is I have a version of /etc/rcS.d/S30rootusr.sh
which wants to call sed and grep. If /usr is not part of the root
partition, then /usr (and so /usr/lib/ld.so.1) is not available at
that early stage of booting.

Thanks,

--Bruce  (Bruce Hamilton, Redondo Beach, CA)

http://home.earthlink.net/~bhami/

2. Setting up a commercial hosting env

3. Question about statically linked executable, glibc and LGPL

4. Weird Netscape problem

5. How to build statically linked executable on Solaris with g++?

6. Variable variables

7. executable with shared lib vs statically linked

8. Downloading Linux

9. Creating a statically linked executable

10. Building a statically linked executable

11. Making statically linked binaries for use by anonymous FTP

12. Why does Lynx2-4-2 come out statically-linked?

13. statically-linked Pan binaries?