代码::块错误的“主要”的多个定义 [英] Code::Blocks error multiple definition of 'main'

查看:65
本文介绍了代码::块错误的“主要”的多个定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装我的第一个程序,但没有运行。由于默认程序正确运行。我将新文件创建为File> new> empty file,并另存为.cpp,但该程序无法运行。我已经将书中的程序和默认程序匹配了。
有什么问题

i tried to install my first program but it doesnt run. As the default program runs correctly. I created the new file as File>new>empty file and saved as .cpp but the program doesnt run. Ive matched the program from the book and the default one.. What is wrong

推荐答案

您只能有一个主要。通过删除Untitled.cpp文件,您将只有一个文件main.cpp。您给新文件起一个名字,而不是使用默认名称 Untitled.cpp。或者您可以简单地创建一个新项目

you can only have one main. By removing the Untitled.cpp file you will only have one file, main.cpp. you give your new file a name instead of taking the default name "Untitled.cpp". Or you can simply create an new project

这篇关于代码::块错误的“主要”的多个定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆