Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 链接器错误:可能发生了什么?_C_Gcc_Compilation_Linker - Fatal编程技术网

C 链接器错误:可能发生了什么?

C 链接器错误:可能发生了什么?,c,gcc,compilation,linker,C,Gcc,Compilation,Linker,我知道这里没有多少人有心灵感应能力,但我会尽力提供尽可能多的信息,以便有人能帮助我调试我认为在我试图编译的某些程序中存在的链接器错误 因此,程序是cilkprof(请参阅,警告:tgz文件)。其中有一个Makefile,我只将其varCXX=icpc更改为CXX=g++。其他一切都是平等的 /usr/bin/ld: ../../3rdparty/pintool/intel64/lib/libpin.a(util_host_ia32e.os): relocation R_X86_64_PC32

我知道这里没有多少人有心灵感应能力,但我会尽力提供尽可能多的信息,以便有人能帮助我调试我认为在我试图编译的某些程序中存在的链接器错误

因此,程序是
cilkprof
(请参阅,警告:tgz文件)。其中有一个
Makefile
,我只将其var
CXX=icpc
更改为
CXX=g++
。其他一切都是平等的

/usr/bin/ld: ../../3rdparty/pintool/intel64/lib/libpin.a(util_host_ia32e.os): 
relocation R_X86_64_PC32 against symbol `DoXsave' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [linux64/cilkprof.so] Error 1

我知道我应该理解
libpin.a
应该用
-fPIC
重新编译,但是我已经编译了pin版本。知道我做错了什么吗?如果有什么不清楚,请询问。谢谢。

在我看来,Makefile试图构建一个共享库,并将其链接到一个静态的非PIC库,这是很好的,这是你做不到的。因此,如果您无法使用
-fPIC
重新编译库,那么我看到的唯一解决方案就是修改Makefile并构建一个静态库。

您是否尝试构建一个共享库?@mux:是的,它是一个.So库