Fix linker errors.
Build failure reported on kubuntu 14.04: $ make cc -O2 -s -Wall -fPIE -pie -ldl -o userhosts userhosts.c /tmp/ccVLIqoI.o: In function `dlsym_or_abort.part.0': userhosts.c:(.text.startup+0x5): undefined reference to `dlerror' /tmp/ccVLIqoI.o: In function `init': userhosts.c:(.text.startup+0x42): undefined reference to `dlerror' userhosts.c:(.text.startup+0x55): undefined reference to `dlsym' userhosts.c:(.text.startup+0x69): undefined reference to `dlerror' userhosts.c:(.text.startup+0x7c): undefined reference to `dlsym' collect2: error: ld returned 1 exit status make: *** [userhosts] Error 1 Fix's rationale seems to be provide -ldl *after* symbol need becomes known, so after source code is provided & built.
Showing
Please register or sign in to comment