对“WinMain@16"错误的未定义引用 [英] undefined reference to `WinMain@16' error

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

问题描述

出现错误:c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): 未定义的引用`WinMain@16'collect2.exe:错误:ld 返回 1 个退出状态

Getting error: c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status

在 Virtual Studio Code 中编译一个简单的 c 程序.

while compiling a simple c program in Virtual Studio Code.

我的代码:

#include <stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

即使我提供了环境变量,我也安装了 mingw 软件.仍然出现此错误.

I have also installed mingw software even i have give the environment variable. Still getting this error.

推荐答案

您创建了一个类型为 Windows Application 的应用程序.创建一个控制台应用程序或将当前应用程序的类型更改为控制台一.

You have created an application with type of Windows Application. Create a Console Application or change type of current application to console one.

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

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