VS 2015 - Change C++ project whose preprocessor definitions are used

Peter Gaczi 26 Reputation points
2022-01-21T16:08:15.907+00:00

VS 2015 - My solution contains 3 C++ projects.

The wrong code blocks are greyed out.

How can I change the C++ project whose preprocessor definitions are used in the text editor?

Thanks, P

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 122.6K Reputation points
    2022-01-21T16:21:08.817+00:00

    For example, right-click the project in Solution Explorer, select "Properties", go to "C/C++", "Preprocessor", and define the required symbols in the "Preprocessor Definitions" fields. Make sure that you also select the appropriate (or "All") Configuration and Platform from comboboxes.


  2. Peter Gaczi 26 Reputation points
    2022-01-23T15:27:52.28+00:00

    The Answer -

    If you have added a source or header file to two projects in your solution, it will be listed twice, once under each project in the Solution Explorer window.

    The preprocessor definitions of the project whose list you have used to open the file will apply.

    If you then mouse-click that file name under the other project, the preprocessor definitions of other project will obtain.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.