session-replay-tools / tcpcopy

An online request replication and TCP stream replay tool, ideal for real testing, performance testing, stability testing, stress testing, load testing, smoke testing, and more.
http://session-replay-tools.github.io/tcpcopy/
Other
4.38k stars 1.02k forks source link

linker error when compile on centos #181

Closed companycy closed 2 weeks ago

companycy commented 10 years ago

Follow guide on centos 6

  1. ./configure --enable-mysqlsgt --enable-mysql --enable-udp --enable-rlantency
  2. sudo make && make install

Get below error: /bin/sh ../../libtool --tag=CC --mode=link gcc -g -O2 -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wall -Wunused-function -pedantic -I../communication -I../core -I../event -I../interception -I../digest -I../mysql -I../tcpcopy -I../util -o tcpcopy tc_udp_session.o tc_packets_module.o tc_message_module.o tc_manager.o main.o ../core/libcore.a ../util/libutil.a ../event/libevent.a ../communication/libcommunication.a -lm -lcrypto libtool: link: gcc -g -O2 -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wall -Wunused-function -pedantic -I../communication -I../core -I../event -I../interception -I../digest -I../mysql -I../tcpcopy -I../util -o tcpcopy tc_udp_session.o tc_packets_module.o tc_message_module.o tc_manager.o main.o ../core/libcore.a ../util/libutil.a ../event/libevent.a ../communication/libcommunication.a -lm -lcrypto tc_manager.o: In function tcp_copy_release_resources': /home/chenying/tcpcopy/src/tcpcopy/tc_manager.c:184: undefined reference totc_destroy_sha1' /home/chenying/tcpcopy/src/tcpcopy/tc_manager.c:185: undefined reference to tc_destroy_digests' /home/chenying/tcpcopy/src/tcpcopy/tc_manager.c:191: undefined reference torelease_mysql_user_pwd_info' main.o: In function set_details': /home/chenying/tcpcopy/src/tcpcopy/main.c:859: undefined reference toretrieve_mysql_user_pwd_info' main.o: In function main': /home/chenying/tcpcopy/src/tcpcopy/main.c:977: undefined reference totc_init_digests' /home/chenying/tcpcopy/src/tcpcopy/main.c:978: undefined reference to tc_init_sha1' collect2: ld returned 1 exit status make[2]: *** [tcpcopy] Error 1 make[2]: Leaving directory/home/chenying/tcpcopy/src/tcpcopy' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory `/home/chenying/tcpcopy/src' make: * [all-recursive] Error 1

After investigation, it's found that it's necessary to make under digest dir, and add libdigest.a explicitly.

Thus, it looks like: gcc -g -O2 -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wall -Wunused-function -pedantic -I../communication -I../core -I../event -I../interception -I../digest -I../mysql -I../tcpcopy -I../util -o tcpcopy tc_udp_session.o tc_packets_module.o tc_message_module.o tc_manager.o main.o ../core/libcore.a ../util/libutil.a ../event/libevent.a ../digest/libdigest.a ../mysql/libmysql.a ../communication/libcommunication.a -lm -lcrypto

I am not so familiar with config.ac or makefile thing. Pls help fix it, and thanks a lot!

wangbin579 commented 10 years ago

"--enable-udp" is only for udp replay. For MySQL session replay,try to use

./configure --enable-mysql