D8048: 无法编译 C 文件“openssl\applink.c”带 /ZW 选项
我正在尝试在我的 Metro 应用程序中使用 OpenSSL。我创建了一个 C++ WinRTComponent 并在该组件下有 openssl 文件
但是,当我尝试编译该项目时,出现以下错误: D8048:无法使用 /ZW 选项编译 C 文件“openssl\applink.c”
任何人都可以告诉我应该如何解决此问题以使我的项目能够编译?
如果您需要任何其他信息来帮助我,请告诉我。
谢谢,
I am trying to use OpenSSL in my metro application. I created a C++ WinRTComponent and have openssl files under this component
However, when I try to compile the project, I got the following error:D8048: cannot compile C file 'openssl\applink.c' with /ZW option
Anyone can tell me how should I resolve this problem to get my project to compile?
Please let me know if you need any other info to help me.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误消息正是它所说的 - VC++ 不支持 C++/CX 扩展 - 使用 /ZW 编译器开关启用 - 在编译为 C 的文件中(这有点有意义,因为这些扩展是面向对象的)。
您看到此情况的原因是,默认情况下,Metro C++ 项目中的所有文件都是使用 /ZW 编译的。不幸的是,这也适用于 .c 文件,尽管它实际上并不适用于它们。您需要的是有选择地禁用这些文件的扩展名。您可以通过右键单击->;解决方案资源管理器中文件或所选文件的属性。在“属性页”对话框中,导航到 C/C++ ->常规,然后查找“启用 Windows 运行时扩展”。
The error message is exactly what it says it is - VC++ does not support C++/CX extensions - enabled with /ZW compiler switch - in files compiled as C (which kinda makes sense, since those extensions are object-oriented).
The reason why you're seeing this is that, by default, all files in a Metro C++ project are compiled with /ZW. Unfortunately, this also applies to .c files, even though it doesn't actually work for them. What you need is to disable the extensions selectively for those files. You can do so via right-click -> Properties on a file or a selection of files in Solution Explorer. In the Property Pages dialog, navigate to C/C++ -> General, and look for "Enable Windows Run Time Extensions".