如何在Code :: Blocks中使用wmain()入口点? [英] How do I use the wmain() entry point in Code::Blocks?

查看:160
本文介绍了如何在Code :: Blocks中使用wmain()入口点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新安装了Code :: Blocks(我安装了用于Windows 7的使用GCC编译器(codeblocks-10.05mingw-setup.exe).然后,我尝试编译此非常简单的代码:

I did a fresh install of Code::Blocks (I installed the one for Windows 7 which comes with GCC compiler (codeblocks-10.05mingw-setup.exe)). Then I tried to compile this very simple code:

int wmain(int argc, wchar_t* argv[])
{
    return 0;
}

我收到此错误消息:

c:\ development \ ide \ codeblocks \ mingw \ bin .. \ lib \ gcc \ mingw32 \ 4.4.1 ...... \ libmingw32.a(main.o):main.c || 未定义对`WinMain @ 16'|的引用|| ===构建完成:1个错误,0个 警告=== |

c:\development\ide\codeblocks\mingw\bin..\lib\gcc\mingw32\4.4.1......\libmingw32.a(main.o):main.c|| undefined reference to `WinMain@16'| ||=== Build finished: 1 errors, 0 warnings ===|

当我尝试使用main()条目运行代码时,它按预期运行,没有任何错误或警告.如何在代码中使用wmain()?我必须做什么修改?

When I try to run my code with a main() entry, it runs as expected without any errors or warnings. How can I use wmain() in my code? What modifications do I have to do?

推荐答案

Mingw不完全支持unicode.如果您想尝试一下,可以使用包装器. https://github.com/coderforlife/mingw-unicode-main

Mingw does not fully support unicode. There is a wrapper available if you feel like trying it out. https://github.com/coderforlife/mingw-unicode-main

这篇关于如何在Code :: Blocks中使用wmain()入口点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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