You are not logged in.

#1 2005-11-17 04:54:14

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

Linker problem compiling static binary

Hi,

I am trying to produce a statically linked binary of an app. I have written, but I get the following error message when I use -static in CFLAGS:

/usr/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status
make: *** [xnec2c] Error 1

The library seems to be there:

5b4az src # locate gtk-x11-2.0
/usr/lib/libgtk-x11-2.0.so.0
/usr/lib/libgtk-x11-2.0.so
/usr/lib/libgtk-x11-2.0.so.0.800.6

This is using arch 0.7. I installed arch 0.7.1 on my second hard disk but have the same problem. The app. compiles and runs if -static is not used in CFLAGS.

My thanks in advance for any hints!


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

#2 2005-11-17 05:20:38

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: Linker problem compiling static binary

Try adding:
-L/usr/lib
to the gcc line.

Offline

#3 2005-11-17 05:35:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Linker problem compiling static binary

Umm in order to statically linked, you need a static library - not a "so" which stands for "shared object" - you're looking for libgtk-x11-2.0.a

Offline

#4 2005-11-17 05:56:29

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

Re: Linker problem compiling static binary

phrakture wrote:

Umm in order to statically linked, you need a static library - not a "so" which stands for "shared object" - you're looking for libgtk-x11-2.0.a

Thanks! How did I ever manage to write Linux software  :oops:

I will see what I can do to fix this...


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

Board footer

Powered by FluxBB