I am compiling a legacy C code here and there is a lot of variables and struct members named "interface", but VC2008 express is complaining about these, do you know how to disable this?
I already changed settings to compile the code only as a C code, but no effect on this.
C++0x Core Language Features Visual Studio 2010 gives developers powerful new core language features from the upcoming C++0x standard.
Basically, Visual Studio 2015 supports compiler Visual C++ 14.0.
C++11 features in Visual Studio 2012.
MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available in both trialware and freeware forms. It features tools for developing and debugging C++ code, especially code written for the Windows API, DirectX and . NET.
Problem is that MS #defines interface to struct so that
interface Name {...}
can be used in COM c++ code.
(objbase.h:199: #define interface __STRUCT__
)
Just #undef interface
after including Windows.h ..
Do a
#define interface QQInterface
before your code (eg. in the header file), this way everywhere where the keyword interface is used, the compilers sees "QQInterface", which is not a keyword. If all code includes this define, you will not get compiler or linker errors.
If you are trying to compile reasonably portable C code, it might be worth disabling the Microsoft language extensions (/Za on the command line, Configuration Properties > C/C++ > Language in VS) and see if the code compiles then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With