Linking ja2 fails on Ubuntu 13.04

Issue #50 resolved
created an issue

when compiling b8d21a657381d93f9d2e5de94df8bc9edb88fbaa on Ubuntu 13.04 I get the following linker error:

joki@neo:~/src/development/ja2-stracciatella$ LANG=C make
===> LD ja2
/usr/bin/ld: _build/lib-gtest/src/gtest.o: undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_key_delete@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/ so try adding it to the linker command line
/lib/x86_64-linux-gnu/ could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [ja2] Error 1

Simple fix is adding -lpthread to the linker options, but I don't know, if it breaks other platforms:

diff --git a/Makefile b/Makefile
index 26a50af..96cce01 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,8 @@ CXXFLAGS += $(CFLAGS)

 LDFLAGS += -lm

+LDFLAGS += -lpthread
 ifdef WITH_ZLIB
 LDFLAGS += -lz

Comments (1)

  1. Log in to comment