C代码在Linux中使用MingW32编译的根本原因,但是Visual Studio C有问题

发布于 2025-02-11 03:32:06 字数 731 浏览 0 评论 0 原文

因此,我想知道为什么C代码为我汇编MingW32(此处此程序fo reference )没有任何错误或提及错误(除了在标题的命名中某些案例敏感性以外,我的意思是)

,当我在Visual Studio 2019中尝试时,我会得到以下“错误”,需要清洁这些“错误”向上。

Error   C2440   '=': cannot convert from 'const wchar_t [15]' to 'LPWSTR'   adduser-test2   C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp    39  
Error   C2440   '=': cannot convert from 'const wchar_t [6]' to 'LPWSTR'    adduser-test2   C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp    38  

是“更安全的代码”的某种严格编译器设置?或者是一个编译器实际上只能将const wchar_t转换为可以在必要时转换为WCHAR_T的指针

So Im wondering why C code compiled for me with mingw32 (this program here fo reference https://github.com/newsoft/adduser) with no issues or mentions of errors (other than some case-sensitivity in naming of the headers i mean)

Though, when I tried in Visual Studio 2019 I get the following "errors" that need to be cleaned up.

Error   C2440   '=': cannot convert from 'const wchar_t [15]' to 'LPWSTR'   adduser-test2   C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp    39  
Error   C2440   '=': cannot convert from 'const wchar_t [6]' to 'LPWSTR'    adduser-test2   C:\Users\Administrator\source\repos\adduser-test\adduser-test2\adduser-test2.cpp    38  

Is it some sort of strict compiler settings for "safer code"? Or is one compiler actually just able to convert a const wchar_t could convert to a pointer to a wchar_t if necessary

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文