"No rule to make target 'install'"......但是Makefile存在
"No rule to make target 'install'"... But Makefile exists
我在安装C++库时遇到问题。CMake 命令成功并生成生成文件,但它会发出警告:
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.
CMakeList 中的第 27 行.txt 是
Boost_LIBRARY_DIR_DEBUG:PATH=/usr/local/lib
我不明白为什么这个警告会给我带来任何问题。但是当我运行make install时,我收到一个错误:
make: *** No rule to make target `install'. Stop.
有什么想法吗?
你能提供一个完整的制作文件吗?但是现在我可以告诉 - 您应该检查"安装"目标是否已存在。因此,请检查 Makefile 是否包含
install: (anything there)
线。如果没有,就没有这样的目标,所以制定是有权利的。可能您应该仅使用"make"命令进行编译,然后按原样使用它或手动安装自己。
安装不是任何标准,它只是一个常见的目标,可能存在,但不是必需的。
我收到相同的错误消息,我的问题是运行命令make install
时我不在正确的目录中。当我更改为具有我的makefile的目录时,它可以工作。
所以你可能不在正确的目录中。
我也遇到了同样的错误。这是修复:如果您使用的是 Cmake-GUI:
- 清理Cmake-GUI文件菜单中加载库的缓存。
- 配置库。
- 生成 Unix 文件。
如果您错过了第三步:
没有规则使目标"安装"。 停。
将发生错误。
确保你有cmake
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
确保您与Makefile
位于同一目录中。
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 当我在第一个循环中使用"auto"时,它工作正常,但是使用"int"它会给出错误,为什么?
- 代码在我的计算机上运行良好,但是在将其提交给coursera时遇到未知的信号11问题
- 针对遗留库的链接:来自预制makefile的-lgfortranbegin
- 使用 Makefile 中的头文件编译 Pybind (不使用 cmake)
- 我有三个 getline,但是一旦编译,输入就太多了
- 如何在使用Makefile构建后在cmd中运行该程序?
- Makefile g++ 使用命令行中的 -D 变量进行编译,默认值
- 我要求用户输入大小和数组,但是当我打印矢量时,它仅显示'0'作为输出
- @CPPFLAGS@在 Makefile.in 中意味着什么?
- 如何在macOS上使用Makefile?
- Makefile 创建两个库 - 一个依赖于另一个
- 我将 Makefile 更改为 C++11 版本,但仍然收到列表初始值设定项错误
- 我在 C++ 中创建了一个函数来递归反转字符串,但是之后如何使功能打印一个 endl?
- Arduino-Makefile:编译器无法编译用户库 cpp 文件
- Makefile by ocaml 和 cpp 扩展名
- C++ 如何将两个 makefile 对象目标规则(位于另一个文件夹中)合并到一个目标/规则中?
- 从 Makefile 中的 $@ 获取文件名
- 如果我们在其中输入一个整数,则字符会给出整数作为输出,但是当分配给它一个整数时,这不会发生。为什么?
- "No rule to make target 'install'"......但是Makefile存在