what means is defined in DSO /lib64/libz.so.1

Nils Philippsen nils at redhat.com
Tue Mar 6 17:17:56 UTC 2012

On Tue, 2012-03-06 at 17:10 +0000, Sérgio Basto wrote:
> Hi , I found this error 
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../lib64/libgpac_static.a(base_encoding.o): undefined reference to symbol 'deflate'                                                              
> /usr/bin/ld: note: 'deflate' is defined in DSO /lib64/libz.so.1 so try
> adding it to the linker command
> line                                                                                                   
> /lib64/libz.so.1: could not read symbols: Invalid
> operation                                            
> collect2: error: ld returned 1 exit status
> Could someone help me , to understand what happens ? 

AIUI, it looks like the code you try to compile uses the deflate()
function from libz, and doesn't link it directly (i.e. the "-lz"
compiler option) but indirectly (i.e. links a library which uses libz).
You need to explicitly link all libraries that you use, you may not
depend on other libraries pulling these in.

Nils Philippsen      "Those who would give up Essential Liberty to purchase 
Red Hat               a little Temporary Safety, deserve neither Liberty
nils at redhat.com       nor Safety."  --  Benjamin Franklin, 1759
PGP fingerprint:      C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011

More information about the devel mailing list