Make Visual Studio 2017 IDE #define __cplusplus when looking at header file

709 views Asked by At

I'm using Visual Studio 2017 to work with an embedded project with both C and C++ files, and I'm using a C++ compiler for everything.

When viewing a header file in the IDE, the predefined symbol __cplusplus is not defined. This affects the Intellisense syntax highlighting and can result in spurious errors indicated by the wavy red underline and blocks of code being incorrectly grayed out as not active.

How can I tell the IDE I'm using the C++ compiler when viewing a header file so that __cplusplus is defined?

0

There are 0 answers