Erroneous intellisense error "Identifier is undefined"

CS 20 Reputation points
2023-07-14T10:59:02.8966667+00:00

After updating Visual Studio from 17.0.2 to the latest version, intellisense fails to find typedefs in other files in the following configuration, even in new projects:


typedef float f32;
#include "b.cpp"
f32 foo;

b.cpp is set to "Does not participate in build", i.e. is in the same compilation unit.

Compiles just fine, but f32 foo; is marked red by intellisense with E0020 identifier "f32" is undefined.

Worked before updating.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,419 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,850 questions
{count} votes

Accepted answer
  1. Minxin Yu 12,596 Reputation points Microsoft Vendor
    2023-07-17T07:07:42.6333333+00:00

    Hi,

    I am using Visual Studio Preview latest and occasionally the intellisense worked.

    You could report the problem to Developer Community and post link here.

    enter image description here

    Here's an alternative:

    1. Exclude the b.cpp file from project.

    enter image description here

    1. Drag b.cpp to Visual Studio to open(Or click the #include"b.cpp" -> Go to document), and the intellisense will work.

    enter image description here

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

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.