【问题标题】:make: *** No targets specified and no makefile found. Stop. [ubuntu]make: *** 没有指定目标,也没有找到 makefile。停止。 [Ubuntu]
【发布时间】:2023-03-09 19:48:01
【问题描述】:

我正在尝试构建它 https://github.com/patrikhuber/eos 但我遇到了麻烦。

说明非常简单,正如 gitHub 上所说的那样

构建:

git clone --recursive https://github.com/patrikhuber/eos.git
mkdir build && cd build # creates a build directory next to the 'eos' folder
cmake -G "<your favourite generator>" ../eos -DCMAKE_INSTALL_PREFIX=../install/
make && make install # or open the project file and build in an IDE like Visual Studio

我正在使用“Ninja”作为生成器,看起来 cmake 部分在我得到时成功通过了

-- Configuring done

-- Generating done

-- Build files have been written to: /home/francesco/eos/build

这就是我停止“工作”的地方,或者我无法理解接下来会发生什么的地方。按照说明,我输入

make && make install

我收到了这条消息

make: *** No targets specified and no makefile found.  Stop.

我四处寻找解决方案,但我真的不明白我应该做什么:我试过了 ./配置

但我得到了

bash: ./configure: No such file or directory

有人可以帮忙吗?

谢谢

【问题讨论】:

  • 您查看过build 目录吗?也许您错过了一步(或者说明的作者错过了),将目录更改为build?
  • 嗨,谢谢,我正在从构建目录执行此操作。使用 mkdir build && cd build 创建后,我将立即移至 build 目录
  • 您使用“Ninja”生成器,因此构建项目时使用ninja,而不是make。
  • 那么我应该使用哪一个?我在生成器列表中没有看到“make”
  • @Francesco 您可以调用“cmake -G”来显示所有平台可用的生成器——当然生成器需要工具/ide 是安装程序。您也可以使用“忍者”——但这是第 3 方工具,您必须安装/下载它。可以阅读这个手册页:cmake.org/cmake/help/v3.11/manual/cmake-generators.7.html

标签: c++ ubuntu cmake


【解决方案1】:

它始终取决于您的 CMake“生成器”。 'make' 是 linux/mingw 工具/命令。对于 VisualStudio,您可以使用 nmake 或 sln/proj 生成的东西。

更可靠的可能是利用 CMake 进行构建,即“NMake Makefiles”生成器:

cmake --build <build folder> --target install

或

cmake --build <build folder> --config release --target install

用于 VisualStudio 生成器

【讨论】:

    猜你喜欢
    • 2013-01-02
    • 1970-01-01
    • 1970-01-01
    • 2014-10-18
    • 1970-01-01
    • 2017-08-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多