为c++程序创建makefile,以便与c++一起运行
Creating makefile for a C++ program to run with g++
我在一个名为"helloworld.cpp"的文件中有一个示例程序:
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
cout<<"Hello World!";
return 0;
}
我想写一个makefile,如下所示:
all: g++ helloworld.cpp -o helloworld
现在我在windows上,无法测试这个。然而,当我提交到一个网站(www.gild.com),它告诉我,由于构建错误,提交已经失败。有人能指出这里有什么问题吗?
要在依赖项所在的行上运行操作。试试这个:
all:
g++ helloworld.cpp -o helloworld
确保是一个制表符,而不是任意数量的空格
如果您的解决方案只包含一个类,则不需要makefile
http://www.gild.com/challenges/details/code_submission_guidelines?keyword=missile编辑:此外,您还需要确保您的文件夹组织正确。这是一个很好的开始http://community.gild.com/gild/topics/help_me_to_submit_helloworld_solution_in_java
相关文章:
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- 代码在main()中运行,但在函数中出现错误
- 我在c++代码中生成了一个运行时#3异常
- 如何在linux终端中同时编译和运行c++代码
- 为什么在运行时没有向我们提供有关分段错误的更多信息?
- 如何在运行中期切换GTK CSS style_context
- 如何在MS Visual Studio 2019中运行QT UI
- 如何通过cpp程序运行shell脚本
- IPC使用多个管道和分支进程来运行Python程序
- 删除指向指针的指针是运行时错误吗
- 如何用参数值调用函数(仅在运行时已知)
- 为什么即使使用-cudart-static进行编译,库用户仍然需要链接到cuda运行时
- 是否可以在编译时初始化数组,以便在运行时不会花费时间?
- c++中的指针和运行时错误
- 在C应用程序中运行C++(带有STL)函数
- 运行程序时出现问题
- 控制允许动态运行c++的并发操作数
- 无法获取菜单选择以运行函数.C++