我在项目中使用这些库
并使用编译我的项目
g++ -std=c++1y -I ../../date main.cpp -lpthread -lsqlpp-mysql -lmysqlclient -lboost_system -ljson11
直到昨天,每天的运行情况都很好。但是现在我收到了这个错误,
┌─[shravan40@Debian] - [~/Work/algorithm] - [Fri Nov 18, 18:33]
└─[$] <git:(riskProfiling*)> g++ -std=c++1y -I ../../date main.cpp -lpthread -lsqlpp-mysql -lmysqlclient -lboost_system -ljson11
/usr/bin/ld: //usr/local/lib/libsqlpp-mysql.a(connection.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libsqlpp-mysql.a(prepared_statement.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libsqlpp-mysql.a(char_result.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libsqlpp-mysql.a(bind_result.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: //usr/local/lib/libsqlpp-mysql.a(connection_handle.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
┌─[shravan40@Debian] - [~/Work/algorithm] - [Fri Nov 18, 18:53]
└─[$] <git:(riskProfiling*)>
最后,我想出了解决方案。
这是g++
版本的问题。最近的版本g++-5
并g++-6
存在此类问题,但是当我恢复到旧g++
版本时,4.9.2
一切运行顺利。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句