ThisHandleNotInUse
ThisHandleNotInUse

Reputation: 1153

"Expected a c++ keyword" in atlbase.h error in intellisense

This intellisense error is driving me nuts in C++/CLI. It suddenly arrived out of nowhere and won't go away. If anyone has any suggestions on how to make it go bye-bye, I'd love to hear them.

The error is from "atlbase.h" - I'd like to pretend to know what this header is, but I don't. There are five errors all occurring on identical lines like this:

#pragma warning(push)  // disable 4483
#pragma warning(disable:4483)
        using namespace __identifier("<AtlImplementationDetails>"); //ERROR HERE
#pragma warning(pop)  // disable 4483

The error is: "expected a c++ keyword" - the whole thing still builds but it really bugs me to have non-existent errors cluttering up stuff.

Other people online have had this exact error and the only suggestions I've seen for it are "disable intellisense errors" (no way is that a "solution") and something like "change build target for OpenCV from version 11 to version 12" (I have no idea what this means - maybe this is my problem - but I have no idea what this means). I am still pretty new to C++ standard library, much less various APIs... do I have OpenCV? I'm just using Visual Studio 2015 standard SDKs.

Here's someone else with the same error

Upvotes: 3

Views: 2348

Answers (2)

Zhikai Zhu
Zhikai Zhu

Reputation: 1

Maybe this is too late but today I get this error message and here is what I did to solve this problem:

First I realized if I don't open any .cpp or .h or even .txt file in the solution in VS. Just rebuild the solution will give no error message.

Once I rebuild with any file open, I will have the keyword error message as you described.

Then I follow the instruction like other people said just delete the sdf file or .NCB file and rebuild without open any file in the solution. You will have no error message with open cpp h txt... files any longer.

Upvotes: 0

1201ProgramAlarm
1201ProgramAlarm

Reputation: 32732

The intellisense data has become corrupted. The way to fix it (that works for me) is to delete the file intellisense builds to hold all the information on your program. In VS2015 it's a SQL Server Compact database in the same folder as your project.

Close your project, open windows explorer and browse to where your project.sln file is. Delete the project.sdf file, then reopen your project. VS will rebuild the intellisense info and (hopefully) your problem goes away.

Note that for earlier versions of Visual Studio the Intellisense file has a different extension; one earlier version uses .NCB, VC++ Intellisense Database. Whatever the extension it is a large file.

Upvotes: 2

Related Questions