我已经在这个问题上研究了一段时间,希望有人可以指出我所缺少的内容。
$ make clean && make libvpnpp.a
c++ -arch x86_64 -arch i386 -I. -I/usr/local/include/ -c VpnInit.cpp
libtool -static -o libvpnpp.a VpnInit.o
libvpnpp.a
make: libvpnpp.a: No such file or directory
make: *** [libvpnpp.a] Error 1
但是,当我执行时ls
,库就在这里:
$ ls *.a
libvpnpp.a
它是多体系结构:
$ lipo -info libvpnpp.a
Architectures in the fat file: libvpnpp.a are: x86_64 i386
以下是相关的makefile规则和配方:
IS_DARWIN = $(shell uname -s | $(EGREP) -i -c "Darwin")
ifeq ($(IS_DARWIN),1)
CXXFLAGS += -arch x86_64 -arch i386
AR = libtool
ARFLAGS = -static -o
endif
...
libvpnpp.a: $(VPNPP_LIB_OBJS)
$(AR) $(ARFLAGS) $@ $(VPNPP_LIB_OBJS)
$(RANLIB) $@
...
%.o : %.cpp
$(CXX) $(CXXFLAGS) -I$(VPNPP_INCL) -I$(CRYPTOPP_INCL) -c $<
即使创建并存在该库,为什么也会make
失败No such file or directory
?
这是来自的尾巴make -d
:
...
c++ -arch x86_64 -arch i386 -I. -I/usr/local/include/ -c VpnInit.cpp
Putting child 0x7fe669c0ff10 (VpnInit.o) PID 59119 on the chain.
Live child 0x7fe669c0ff10 (VpnInit.o) PID 59119
Reaping winning child 0x7fe669c0ff10 PID 59119
Removing child 0x7fe669c0ff10 PID 59119 from chain.
Successfully remade target file `VpnInit.o'.
Finished prerequisites of target file `libvpnpp.a'.
Must remake target `libvpnpp.a'.
libtool -static -o libvpnpp.a VpnInit.o
Putting child 0x7fe669c111d0 (libvpnpp.a) PID 59127 on the chain.
Live child 0x7fe669c111d0 (libvpnpp.a) PID 59127
Reaping winning child 0x7fe669c111d0 PID 59127
libvpnpp.a
make: libvpnpp.a: No such file or directory
Live child 0x7fe669c111d0 (libvpnpp.a) PID 59138
Reaping losing child 0x7fe669c111d0 PID 59138
make: *** [libvpnpp.a] Error 1
Removing child 0x7fe669c111d0 PID 59138 from chain.
$
看起来好像$(RANLIB)
是空的,然后该行$(RANLIB) $@
解析为just libvpnpp.a
。作为一行的第一个单词,shell希望执行一个libvpnpp.a
找不到的程序(可能是因为.
不在中PATH
)。
尝试RANLIB=:
在makefile中或作为make变量进行设置。或调查为什么RANLIB
设置不正确。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句