使命令不产生可执行文件
Make command not producing an executable file
我刚刚开始使用C ,并想使用CMake编译简单的Hello World程序,但是一旦生产了Makefile,我不知道该如何处理。我有一个名为Tutorial的目录,其中包含我的tutorial.cpp文件,其中包含Hello World Code。我也有一个包含:
的cmakelists文件cmake_minimum_required(VERSION 3.14.4)
project (tutorial)
add_executable(tutorial tutorial.cpp)
当我从终端中的教程目录运行命令cmake .
时,所有正确的(至少我认为它们是正确的(文件,我将获得以下输出:
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler:
/Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler:
/Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler:
/Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler:
/Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to:
/Users/kshitijsachan/Documents/cs/cpp/tutorial
i然后在终端中输入make
,没有输出。我该如何实际运行生产的makefile?
运行 make <some_valid_target_name>
-例如 make all
或 make install
(如果存在这种常用的目标(或项目定义的任何其他目标。查看您的项目文档或cmakelists.txt文件中的有效目标名称。
另请参见添加目标的cmake_add_executable。
相关文章:
- 如何将不同的可执行文件合并到一个窗口框架中进行编码?像浏览器一样
- 如何使 windows 命令提示符在C++可执行文件上显示返回值?
- 是否可以在命令行中将输入参数传递给可执行文件
- 如何从命令行使用 cmake 为有根的安卓设备制作可执行文件?
- 提供变量作为 MATLAB 系统命令的输入参数,以便C++可执行文件
- 从命令提示符使用 MSBuild 调试简单的C++可执行文件
- 使命令不产生可执行文件
- 如何从命令行运行可执行文件时启用系统错误消息
- 为什么文件命令声明可执行文件包含"debug_info"
- 使用 php 将带有命令行可执行文件路径的参数传递
- 通过Linux命令行执行时,可执行文件运行正常 - 调用C System()命令时运行时错误
- 使用系统命令调用可执行文件
- 是否可以使用C++中的一个make命令,用两个不同的gcc版本编译两个不同可执行文件
- 用于查找可执行文件依赖项的命令
- 输入/输出从命令行可执行文件重定向到文件
- 如何在C++中调用预编译可执行文件中的函数(通过命令调用)
- c++可执行文件打开命令窗口
- 我如何运行GDB,在命令行中输入文本并查看可执行文件如何处理这些条目
- Xcode 4中的命令行工具构建版本,在构建可执行文件中包含图像存在问题
- 更改可执行文件的图标,而无需重新编译或重新链接,并使用 Microsoft SDK 中的命令行工具