D8048: 'OpenSSL \ applink.c' con / ZW opzione non può compilare il file C
-
25-10-2019 - |
Domanda
Sto cercando di usare OpenSSL nella mia applicazione della metropolitana. Ho creato una ++ WinRTComponent C e avere i file openssl nell'ambito di questa componente
Tuttavia, quando provo a compilare il progetto, ho ottenuto il seguente errore:
D8048: cannot compile C file 'openssl\applink.c' with /ZW option
Chiunque può dirmi come devo risolvere questo problema per ottenere il mio progetto per la compilazione?
Per favore fatemi sapere se avete bisogno di altre informazioni per aiutarmi.
Grazie,
Soluzione
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".