我在安装 C++ 库时遇到问题。 CMake 命令成功并生成 Makefile,但它给出了警告:
CMake Warning (dev) at CMakeLists.txt:27 (LINK_DIRECTORIES):
This command specifies the relative path
../usr/local/lib
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMakeLists.txt 中的第 27 行是
Boost_LIBRARY_DIR_DEBUG:PATH=/usr/local/lib
我不明白为什么这个警告会给我带来任何问题。但是当我运行 make install 时,我得到一个错误:
make: *** No rule to make target `install'. Stop.
有任何想法吗?
原文由 Sean 发布,翻译遵循 CC BY-SA 4.0 许可协议
你能提供一个完整的makefile吗?但现在我可以告诉你——你应该检查“安装”目标是否已经存在。因此,检查 Makefile 是否包含
线。如果没有,则没有这样的目标,因此 make 是正确的。可能您应该只使用“make”命令进行编译,然后按原样使用它或手动安装。
install 不是 make 的任何标准,它只是一个常见的目标,可能存在,但不是必需的。