Undefined reference to symbol 'pthread_create@@GLIBC_2.2.5


#1

Hello

I am compiling citrusleaf_client_libevent2_2.1.41 on ubuntu 14

ubuntu@ip-10-186-144-184:~/citrusleaf_client_libevent2_2.1.41$ cat /proc/version
Linux version 3.13.0-44-generic (buildd@lamiak) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014

and I am getting the following error:

make[2]: Entering directory `/home/ubuntu/citrusleaf_client_libevent2_2.1.41/tests/loop_c_ev2/src'
gcc -L../../../lib -o ../bin/loop_c_ev ../obj/main.o ../obj/loop.o ../obj/shash.o -lev2citrusleaf -levent -lssl -lrt -lcrypto
/usr/bin/ld: ../obj/main.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [loop_c_ev2] Error 1
make[2]: Leaving directory `/home/ubuntu/citrusleaf_client_libevent2_2.1.41/tests/loop_c_ev2/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ubuntu/citrusleaf_client_libevent2_2.1.41/tests/loop_c_ev2'
make: *** [all] Error 2

I am following http://www.aerospike.com/docs/client/libevent/build/debian.html

I am most likely missing something. Please let me know if you have a tip.

Cheers


#2

Please do the following: Edit tests/loop_c_ev2/src/Makefile add “-lpthread” to the LIBRARIES list LIBRARIES = -lev2citrusleaf -levent -lssl -lrt -lcrypto -lpthread