未定义的'WinMain @ 16'C错误引用

Yan*_*ela 4 c eclipse eclipse-cdt

我正在使用Eclipse(C编程),我已经提出了这个代码,但每次构建它时,我都会收到错误消息"未定义引用'WinMain @ 16'".我花了2个多小时试图解决这个问题,但我无法弄清楚我的错误在哪里.有人可以帮忙吗?

这是代码:

#include <stdio.h> 

int main(void)
{
    int input;

    printf("Please enter an integer:\n");
    scanf("%d",&input);
    int temp = input;

    while(input<=temp+10)
    {
        printf("%d ",input);
        input++;
    }

    printf("\n");

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

huy*_*itw 7

编译或构建时,Eclipse不会自动将文件保存到磁盘.但编译器正在使用磁盘上的文件.所以也许你在添加main函数后没有保存文件.