如何从make文件中的ld中删除链接选项?

时间:2016-11-04 16:07:08

标签: makefile ld configure

我正在安装一个ROOT类,但我遇到了一个错误。

caffeinated:libroot-hijing-1.7 sudoankit$ make
/bin/sh ../libtool  --tag=CXX   --mode=link /usr/bin/g++ -std=gnu++11  -g -O2 -L/usr/local/Cellar/root6/6.06.08/lib/root -R /usr/local/Cellar/root6/6.06.08/lib/root -version-info 1:7:0   -o libTHijing.la -rpath /Users/sudoankit/lib THijing.lo THijingMinBias.lo THijingFlow.lo THijingPara.lo TRanMar.lo ran.lo hijing1.383.lo hipyset1.35.lo THijingDict.lo -lCint -lCore -lTree -lPhysics -lGraf3d -lGraf -lHist -lMatrix -lEG  -L/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin16.0.0/6.2.0 -L/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin16.0.0/6.2.0/../../.. -lgfortran -lquadmath -lm
libtool: link: /usr/bin/g++ -std=gnu++11 -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libTHijing.1.dylib  .libs/THijing.o .libs/THijingMinBias.o .libs/THijingFlow.o .libs/THijingPara.o .libs/TRanMar.o .libs/ran.o .libs/hijing1.383.o .libs/hipyset1.35.o .libs/THijingDict.o   -L/usr/local/Cellar/root6/6.06.08/lib/root -lCint -lCore -lTree -lPhysics -lGraf3d -lGraf -lHist -lMatrix -lEG -L/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin16.0.0/6.2.0 -L/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin16.0.0/6.2.0/../../.. -lgfortran -lquadmath -lm  -g -O2   -install_name  /Users/sudoankit/lib/libTHijing.1.dylib -compatibility_version 2 -current_version 2.7 -Wl,-single_module
ld: library not found for -lCint
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libTHijing.la] Error 1
make: *** [all-recursive] Error 1

我在一段时间后找到的解决方案是从-lCint中删除ld库。我该怎么做?链接位于Makefile的哪个位置?还是configure文件?

1 个答案:

答案 0 :(得分:1)

filter-out的一个例子:

A = X Y -lCint Z
B = $(filter-out -lCint, $(A))

all: 
    @echo $(B)