Windows编程错误未定义对winmain @ 16的引用 [英] An error with windows programming undefine reference to winmain@16

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

问题描述

#include< windows.h> // windows.h



int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,PWSTR pCmdLine,int nCmdShow)

{

MessageBox(NULL,TEXT(Hello 2007!),TEXT(Hello Program),0);

返回0; < br $>
}



编码器,

使用此代码我收到错误 - 未定义引用WinMain @ 16

之前我将WinMain的重新声明重新声明为另一个变量。



我尝试了什么:



我在Code :: Blocks中使用GNU GCC编译器中的代码。

#include <windows.h>//windows.h

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
MessageBox(NULL,TEXT("Hello 2007!"),TEXT("Hello Program"),0);
return 0;
}

Coders,
Using this code I got an error - undefine reference to WinMain@16
and before that I got an error redeclaration of WinMain as a different variable.

What I have tried:

I am using this code in Code::Blocks with GNU GCC compiler.

推荐答案

你必须配置你的项目设置。



一个快速的网络研究表明其他人有类似的问题:

c ++ - 对WinMain @ 16(代码块)的未定义引用 - 堆栈溢出 [ ^ ]

codeblocks - C ++未定义的对WinMain @ 16的引用(Code :: Blocks) - Stack Overflow [ ^ ]
You must configure your project settings.

A quick web research shows that others had similar problems:
c++ - undefined reference to WinMain@16 (codeblocks) - Stack Overflow[^]
codeblocks - C++ undefined reference to WinMain@16 (Code::Blocks) - Stack Overflow[^]


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

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