gpt4 book ai didi

c++ - 编译时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:20:53 25 4
gpt4 key购买 nike

我从数据预取锦标赛网站 (http://www.jilp.org/dpc/) 下载了一个软件框架,并安装在装有 64 位 Ubuntu 操作系统的计算机上。我按照解压压缩文件的所有说明进行操作,并输入“make”命令进行编译,这是我收到的:

g++ -Wl,-u,main -g -shared -Wl,-Bsymbolic -Wl,--version-script=/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/source/include/pintool.ver -L/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/Lib/ -L/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/ExtLib/ -L/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/extras/xed2-intel64/lib -L/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/intel64/lib -L/grads/hhoffman/Documents/ELE_591/PREF_KIT/pin-2.5-22247-gcc.4.0.0-ia32_intel64-linux/intel64/lib-ext  -o bin/CMPsim.usetrace ./bin/libCMPsim64.a ./src/prefetch/sample_prefetcher.o -lpin  -lxed -ldwarf -lelf -ldl  /usr/lib/x86_64-linux-gnu/libz.a
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libz.a(gzio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [CMPsimpref64] Error 1

我认为问题出在 libz.a 文件上。帮忙?

最佳答案

我不知道你是如何编译这个应用程序的,但你应该在C/C++文件的编译标志(CFLAGS和CXXFLAGS)中添加-fPIC,然后重新编译应用程序。

关于c++ - 编译时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21896579/

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