[odb-users] problem with static linking

Paul Harrison paul.harrison at manchester.ac.uk
Tue Nov 10 10:17:51 EST 2015


Hi,

I am trying to create a (mostly) statically linked executable that uses odb and mysql - my final link and error is


g++  -Wl,-Bsymbolic  -DLinux_2 -DNOTJIVE -DEMERLIN_DEBUG -g -fPIC -D_FILE_OFFSET_BITS=64    -I/home/emerlin/work/emerlin/include -I/usr/include -I/usr/include/mysql -I/usr/local/include -I/home/emerlin/work/emerlin/qwt/include -I/usr/include/QtGui -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include -I/home/emerlin/work/emerlin/CCfits/include -I/usr/include/cfitsio  -I/home/emerlin/work/emerlin/include -DBROKER_HOST=\"emproc1\" -DEMERLIN data_tool.o -o data_tool -L/home/emerlin/work/emerlin/lib/Linux_2_x86_64 -Wl,-rpath,/home/emerlin/work/emerlin/lib/Linux_2_x86_64 -L/home/emerlin/work/emerlin/lib/Linux_2_x86_64 -L/usr/local/lib64  -L/usr/lib64/mysql -L/home/emerlin/work/emerlin/qwt/lib -L/usr/lib -L/home/emerlin/work/emerlin/CCfits/lib -L/usr/lib -L/usr/X11R6/lib -Wl,-Bstatic -ldh_common  -lojd -larchive_db -ldata_manager -leop_db -lscat  -ldata_exporters  -ldelays -lslalib  -lemerlin_msgs -lemerlin_codes -lmessage_base -lmessage_common -lconfigs_db2  -lconfigs_db -lpersist2 -lslalib -lCCfits -lcfitsio -lherbert -lpersist -lherbert -lstore_classes -lodb -lodb-mysql -lodb-boost -lodb -lsocket++ -lerrors -lutil -lmachine -llocal -lz  -Wl,-Bdynamic -lmysqlclient -lpthread -lboost_serialization-mt -lboost_system-mt -lboost_filesystem-mt -lboost_date_time
/usr/local/lib/libodb-mysql.a(connection-factory.o): In function `~mysql_thread_init':
/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:79: undefined reference to `THR_KEY_mysys'
/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:80: undefined reference to `THR_KEY_mysys'
/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:79: undefined reference to `THR_KEY_mysys'
/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:80: undefined reference to `THR_KEY_mysys'
/usr/local/lib/libodb-mysql.a(connection-factory.o): In function `mysql_thread_init':
/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:69: undefined reference to `THR_KEY_mysys'
/usr/local/lib/libodb-mysql.a(connection-factory.o):/opt/packages/odb/libodb-mysql-2.3.0/odb/mysql/connection-factory.cxx:79: more undefined references to `THR_KEY_mysys' follow
collect2: ld returned 1 exit status
make[1]: *** [data_tool] Error 1
make[1]: Leaving directory `/home/emerlin/work/emerlin/data_tool/source/build/Linux_2_x86_64/data_tool’


I have seen https://bugzilla.redhat.com/show_bug.cgi?id=846602, but my problem is that I am compiling on scientific linux 6.7, which has a rather old version of mysql as standard - before I try to get a more up-to-date version installed, I thought that I would just ask if there is another solution to this problem?

Regards,
	Paul.







More information about the odb-users mailing list