未定义引用'WinMain @ 16'C错误 [英] Undefined reference to 'WinMain@16' C error

查看:139
本文介绍了未定义引用'WinMain @ 16'C错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse(C编程),并且想出了这些代码,但是每次构建它时,都会出现错误消息,即对WinMain @ 16的未定义引用。我花了2个多小时来尝试解决此问题,但无法弄清楚我的错误所在。有人可以帮忙吗?

I am using Eclipse (C programming) and I have come up with this code but every time I build it, I get the error saying, "Undefined Reference to 'WinMain@16'". I have spent over 2 hours trying to solve this problem but I can't figure out my where my error is. Can anyone help?

这是代码:

#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;
}


推荐答案

编译或构建时,文件不会被Eclipse自动保存到磁盘。但是编译器正在使用磁盘文件。因此,也许您只是在添加主要功能后才保存文件。

When you compile or build, files are not automatically saved to disk by Eclipse. But the compiler is using the on-disk files. So maybe you just didn't save the file after you've added the main function.

这篇关于未定义引用'WinMain @ 16'C错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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