c++ - 如何在 Code::Blocks 中使用 wmain() 入口点?

标签 c++ unicode mingw codeblocks wmain

我全新安装了 Code::Blocks(我安装了 the one for Windows 7 which comes with GCC compiler (codeblocks-10.05mingw-setup.exe))。然后我尝试编译这个非常简单的代码:

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|| undefined reference to `WinMain@16'| ||=== Build finished: 1 errors, 0 warnings ===|

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

最佳答案

最新的解决方案是使用 -municode 选项而不是 mingw-unicode-main 包装器。

详情请见:

关于c++ - 如何在 Code::Blocks 中使用 wmain() 入口点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10932473/

相关文章:

c - 无法在 Windows 8 上使用 MinGW 执行 execl()

c++ - int 返回垃圾值

c++ - 如何验证整数输入?

c# - 人们如何在 C# 中重用混合风格?

python - 如何打开 zip 中的 unicode 文本文件?

unicode - Emacs:自动将 LaTeX 替换为 Unicode 符号

c++ - 编译并链接 wxGraphicContext 与 MingW

c++ - MSVC 中 std::string::operator[] 的奇怪行为

C++ - 置换函数

java - 了解典型 Java Web 应用程序中的字符编码