-fPIC重新编译,这个问题只有在64位系统中编译的时候才会出现。-fPIC 作用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code),则产生的代码中,没有绝对地址,全部使用相对地址,故而代码可以被加载器加载到内存的任意位置,都可以正确的执行。这正是共享库所要求的,共享库被加载时,在内存的位置不是固定的。
解决方法:
如果是cmake ,在CMakeList.txt 前面添加: add_compile_options(-fPIC)
/usr/bin/x86_64-linux-gnu-ld: CMakeFiles/minidbg.dir/ext/linenoise/linenoise.c.o: relocation R_X86_6
[ 22%] Built target hello
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
[ 22%] Built target libelfin
[ 33%] Linking CXX executable minidbg
/usr/bin/x86_64-linux-gnu-ld: CMakeFiles/minidbg.dir/ext/linenoise/linenoise.c.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/minidbg.dir/build.make:100: recipe for target 'minidbg' failed
make[2]: *** [minidbg] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/minidbg.dir/all' failed
make[1]: *** [CMakeFiles/minidbg.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
刚刚在
编译
从github下载的源代码进行
编译
,但
编译
的过程中出现了:/usr/bin/
ld
:
final
link
failed
:
Non
repre
sen
table
s
ect
ion
on
output
的错误,导致了
编译
不成功。上网查了一下,大概说是gcc的问题,但具体的问题所在我也不清楚,然后用命令:gcc --vers
ion
查看gcc的版本,结果是4.4.3,在gcc的文件路径下看到 libst
编译
live555的时候遇到了这个问题,前面的
编译
没有问题,是在链接的时候出现的,在网上搜索说是缺少libstdc++ 库。于是,安装之
#sudo apt-get installlibstdc++-dev
shawn@
ubuntu
:~/work/live555-master_1$ sudo apt-get install libstdc++-dev
[sudo] passw...
产生这个错误的原因和链接库有关,具体还不知道为啥,任务太紧了,先把错误解决了再说吧。
arm-
linux
-g++ -Wl,-O1 -Wl,-rpath,/opt/qt-4.8.5-arm/lib -o SDKTest main.o -L/opt/qt-4.8.5-arm/lib libfsdk.so -lQtGui -L/opt/tslib-1.4/lib -L/opt/qt-4.8.
具体
报错
信息如下:/usr/bin/
ld
: /data/app/openssl/lib/libcrypto.a(ecs_asn1.o): relocat
ion
R_X86_64_PC32 against symbol `ECDSA_SIG_it' can not be used when making a shared obj
ect
; recompile with -fPIC/usr/bin/
ld
...
Mysql 安装最方便的是用rpm包, 官方网站有下载。对开发人员来说, 需要下载的包有几个:Mysql-server 服务端Mysql-client 客户端,通过 mysql -uroot -p 可以进入到服务器端查看数据库(看远程主机用 mysql -uroot -p -h192.168.2.33)Mysql-devel 开发需要的头文件,动态库静态库等。 开发的程序需要链接 libmysql...
参考书推荐:《NS与网络模拟》 - 徐雷鸣等1. NS2下载 官网提供最新版本的下载: http://www.isi.edu/nsnam/ns/ , 我下载的版本是NS2.34, 下载的文件为ns-alli
non
e-2.34.tar.gz 。 下载完后将它解压缩到主文件夹下(我的是 /home/yanna): tar xvfz ns-alli
non
e-2.34.tar
/usr/bin/
ld
:/home//vcs安装路径/
linux
64/lib/vcs_save_restore_new.o relocat
ion
R_X86_64_32S against undefined symbol '***’ can not be used when making a PIE obj
ect
,recompile with -fPIC
/usr/bin/
ld
:
final
link
failed
:
Non
repre
sen
table
s
ect
ion
on
output
解决办法:
/usr/bin/
ld
: libavcodec/mqc.o: relocat
ion
R_X86_64_32 against .rodata' can not be used when making a shared obj
ect
; recompile with -fPIC /usr/bin/
ld
: libavcodec/mqcdec.o: relocat
ion
R_X86_64_32S against undefined symbolff_mqc_qe’ can not be used when
从Qt5.15.0起,对于开源用户,Qt官方不再提供独立安装文件,且不再有bug修复版本(比如Qt5.15.1)
如果想体验Qt5.15及之后的版本,就要培养一个新技能——
编译
Qt源码
从
编译
到发布大概需要这么几个步骤:
1. 从Qt官网下载源码;
2.
编译
源码;
3. 将
编译
后的qmake.exe导入QtCreator或者Visual Studio;
4. 使用QtCreator或者Visual Studio
编译
Qt项目;
5. 项目发布可仍然使用windeployqt.exe。
最终解决办法是,忘记之前已经有
编译
过的文件了,先清除一次
编译
过的文件,再次重新
编译
就好了。在野火
Linux
开发板上使用Makefile
编译
文件时出现如下错误。