gpt4 book ai didi

c++ - 最终链接失败 : Nonrepresentable section on output collect2: error: ld returned 1 exit status

转载 作者:搜寻专家 更新时间:2023-10-31 01:33:49 25 4
gpt4 key购买 nike

我正在我的项目中使用这些库

并使用

编译我的项目
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++-5g++-6 有这样的问题,但是当我回到旧的 g++ 版本 4.9.2 一切运行顺利。

关于c++ - 最终链接失败 : Nonrepresentable section on output collect2: error: ld returned 1 exit status,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40678423/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com