我很难理解编译错误/bin/sh:1:/a.out:在helloworld脚本中找不到
I am having trouble understanding a compiling error /bin/sh: 1: ./a.out: not found with hello world script
当我使用众所周知的helloworld脚本时。我终于把所有的东西都准备好了,并修复了所有的错误,但当我编译这个新错误时,它会弹出,告诉我这个/bin/sh:1:/a.out:未找到。
hello.ccp文件的脚本如下:
#include <iostream>
int main()
{
std::cout << "Hello World!n";
return 0;
}
而我的makefile看起来是这样的:
hello.ccp:
g++ -std=gnu++11 hello.cpp
有什么想法吗?非常感谢!
复习手册。目标是a.out
,因为这是要创建的。因此,将hello.ccp
更改为a.out
。由于hello.cpp
是a.out
的先决条件,Makefile需要如下所示:
a.out: hello.cpp
g++ -std=gnu++11 hello.cpp
此外,请确保使用制表符而不是空格来缩进食谱。Makefile需要选项卡。
相关文章:
- IN, OUT, INOUT Parameters
- 即使使用调试编译标志,表达式也是"optimized out"
- C++双重释放或损坏(out)
- 将 out/in out 参数与 if/switch 的 init 语句一起使用
- 在命令行上将输入显示到数组中时如何删除 ./a.out?
- 在Linux上使用Clang / OLLVM交叉编译helloworld Windows可执行文件时的问题
- 构建失败错误:无法使用 qibuild 构建C++ SDK Helloworld
- 为什么我的向量::擦除调用会抛出"vector subscript out of range"?
- 解决方案在第 25 行执行错误'out of bounds'
- C++ 向量加减抛出"expression: vector subscript out of range."错误
- 对函数的 out 字符串参数使用 swap 与赋值
- 运行编译的 a.out 后出现分段错误(核心转储)错误
- 我可以在不创建项目的情况下在Visual Studio 2019中编译和运行HelloWorld.cpp吗?
- 在 Metal 着色器代码中,如何定义函数的 in/out 参数变量?
- 赋值运算符上的双重释放或损坏(out)
- "in"和"out"在参数方向上是什么意思?
- 从 MSVC14 切换到 MSVC16 会导致"compiler is out of heap space (C1060)"错误
- -bash:/a.out:无法执行二进制文件:Exec格式错误
- 庞大的初始化列表,如何修复"fatal error C1060: compiler is out of heap space"
- 我很难理解编译错误/bin/sh:1:/a.out:在helloworld脚本中找不到