一个工程只能有一个main函数
发布于 2006-01-23 12:18 1 阅读:27,395 评论:1 标签: C++

  很奇怪,偶开始在工程test.dev下建立了一个forDeZuoYongYu.cpp文件,出现了exe文件,偶再在这个工程下建立了test1.cpp文件,结果exe文件没了,还出了下面的提示:

  test1.cpp D:\yayu\C++Test\test1.o(.text+0x6) multiple definition of `main'

  forDeZuoYongYu.cpp D:\yayu\C++Test\forDeZuoYongYu.o(.text+0x6) first defined here

   D:\yayu\C++Test\Makefile.win [Build Error]  [Test.exe] Error 1 

  百思不得其解,咨询了一下李马才明白"你可以有多个c/cpp文件来组成这个工程,这些文件中可以包括多个函数或者类的实现,但是main只能有一个"  

晕倒!

晕倒!...
狂汗...

by sinper 2008-03-29 21:03:51
Warning: Trying to access array offset on value of type bool in /opt/bitnami/apache/htdocs/workingsmarty/templates_c/e21e83752348f01f75c472238af0e4512d51cc32_0.file.left_look.html.php on line 154

别这样好不好

那时刚开始学

人之初都不会嘛

站长回复

Warning: Trying to access array offset on value of type bool in /opt/bitnami/apache/htdocs/workingsmarty/templates_c/e21e83752348f01f75c472238af0e4512d51cc32_0.file.left_look.html.php on line 172