我设置了什么选项来使用main()而不是wmain()(What option do I set to use main() instead of wmain())

编程入门 行业动态 更新时间:2024-10-23 15:28:53
我设置了什么选项来使用main()而不是wmain()(What option do I set to use main() instead of wmain())

我有一个工作的Visual Studio项目,它使用wmain()作为入口点。 我想用main()来代替。

如果我简单地将函数签名更改为int main() ,我会得到:

错误LNK2019:无法解析的外部符号_wmain在函数中引用“void __cdecl mainCRTStartupHelper(struct HINSTANCE__ *,unsigned short const *)”

我需要更改哪些选项才能使链接成功?

I have a working Visual Studio project that uses wmain() as the entry-point. I would like to use main() instead.

If I simply change the function signature to int main(), I get:

error LNK2019: unresolved external symbol _wmain referenced in function "void __cdecl mainCRTStartupHelper(struct HINSTANCE__ *,unsigned short const *)"

What option do I need to change to make the link succeed?

最满意答案

我通过猜测发现了一个解决方案。

Configuration Properties > Linker > Advanced > Entry Point

是: mainWCRTStartup

现在: mainCRTStartup ##已删除W

构建成功。

I found a solution by guessing.

Configuration Properties > Linker > Advanced > Entry Point

was: mainWCRTStartup

now: mainCRTStartup ## removed W

Build succeeded.

更多推荐

本文发布于:2023-07-31 01:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340471.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   选项   main   set   wmain

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!