hoche / cicb

ICB chat client. See www.icb.net
GNU General Public License v3.0
11 stars 4 forks source link

Static Linking Requires Extra Libraries #5

Open justdan96 opened 3 years ago

justdan96 commented 3 years ago

As title on Ubuntu 20.04.1 LTS, running "./configure --enable-static" results in a Makefile that cannot link correctly. The libz and libpthread libraries are missing, which results in linking errors as methods from these libraries cannot be found.

In order to resolve this I had to change the Makefile after generation, from this

LIBS         = -static $(TCLLIBS) $(READLINELIBS) -ldl -lm  -ltermcap -lc

To:

LIBS         = -static $(TCLLIBS) $(READLINELIBS) -lz -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -ldl -lm  -ltermcap -lc

The same compiles and links just fine when creating a shared executable.