C 编程对‘WinMain@16’的未定义引用 [英] C Programming undefined reference to `WinMain@16'

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

问题描述

我正在尝试使用带有记事本的 gcc (tdm-1) 4.7.1 和 Windows 10 上的命令提示符编译以下代码.以前将 bin 文件夹路径添加到全局变量,但是当我尝试编译时出现以下错误对‘WinMain@16’的未定义引用".但是,相同的代码在代码块上也能正常工作!

I'm trying to compile following code using gcc (tdm-1) 4.7.1 with notepad, and command prompt on windows 10. previously add bin folder path to global variables,but when i try to compile i get following error " undefined reference to `WinMain@16'".However same code works fine with codeblocks!.

PS:我像这样编译它cd/d path of code then gcc filename.c"

PS: I compile it like this "cd /d path of code then gcc filename.c"

#include<stdio.h>

int main(){

    printf("Hello world");
    return 0;
}

推荐答案

我无意中发现了什么问题.通过记事本编写代码后,我忘记保存文件 ctrl+s 所以我只是尝试编译空文件.

I found What was wrong accidentally.After writing my code through notepad,I forgot to save file ctrl+s so i just trying to compile empty file.

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

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