undefined reference to symbol 'uncompress', DSO missing from command line
Matthew Martinez
I'm trying to manually compile my php iconv extension so it uses libiconv instead of glibc. I downloaded libiconv, and configured with ./configure --prefix=/usr/local , make then sudo make install.
I found this instructions about manual compiling:
I have a php version 5.6.10 and it was installed using phpbrew so I started at Step #3.
At step #5 (make), I encountered the following error:
/usr/bin/ld: ext/standard/.libs/image.o: undefined reference to symbol 'uncompress'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1Would you know how to fix this? Thanks a lot.
31 Answer
I solved this by editing the Makefile, and adding -lz in EXTRA_LIBS.
- Look for
Makefilein thephpdirectory. - Search for
EXTRA_LIBS. - Add the
-lzflag.
That links to the library that was missing. -lz links to zlib.
This solution is based on kevinf's answer to Strange linking error: DSO missing from command line on Stack Overflow.
0