首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

新手,

2012-02-05 
新手求助,急!!!小弟,刚学C语言,按书上打了个程序,他妈的电脑不给我运行。大家帮忙看看到底是我程序没设置好

新手求助,急!!!
小弟,刚学C语言,按书上打了个程序,他妈的电脑不给我运行。大家帮忙看看到底是我程序没设置好,还是什么原因?

/* A first C program. Just writes a message, then exits.
  Alistair Moffat, alistair@cs.mu.oz.au, July 2002.
*/
#include <stdio.h>

int
main(int argc, char **argv) {
printf("Hello world!\n");
return 0;
}



**** Build of configuration Debug for project fromthebook ****

**** Internal Builder is used for build ****
gcc -ofromthebook.exe helloworld.o
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0xbd): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 2328 ms.  



[解决办法]
可能是工程类型有问题.
要console的
[解决办法]
新建工程,选择工程类型为win32 console application的试试
[解决办法]
新建 工程 win32 console application

热点排行