D8048: cannot compile C file 'openssl\applink.c' with /ZW option

╄→尐↘猪︶ㄣ 提交于 2019-12-04 18:54:15

问题


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,


回答1:


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".



来源:https://stackoverflow.com/questions/9304862/d8048-cannot-compile-c-file-openssl-applink-c-with-zw-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!