Related
We are currently evaluating the new Visual Studio 2015 and encountered a strange problem with IntelliSense. When I compiled our main solution with the new studio the build succeeds, but nevertheless 6 errors are shown.
I discovered that it's not a real error, but only an intellisense error. The code is definitely correct and everything compiled successfully. The code however is marked red and errors show up in the error list.
All 6 errors have the same origin. It's a simple constructor call. Strange enough, but there are also some occurrences of the exact same constructor without any errors.
The error message:
Code: CS1729
Message: '<the class>' does not contain a constructor that takes that many arguments.
Project: <the project name>
File: <the path to the file>
The new studio was installed on a freshly installed Windows 7 without any legacy software (no VS13).
I've already tried to clear the caches, deleted the suo file, deleted bin and obj directories, cleaned and rebuilt the solution etc. But nothing worked.
Can anyone explain that behavior to me?
I had thousands of intellisense errors and 0 build errors. After deleting .suo file and restarting VS intellisense errors are gone.
Suo file is located relatively to source in:
.vs\SolutionName\v14\.suo
According to comment: Beware that *.suo is a hidden file.
Edit: According to comments, VS2017 has the same issue, so you can use similar solution: Delete .vs\SolutionName\v15\.suo
VS2019 still has this issue. Delete .vs\SolutionName\v17\.suo
If deleting .suo still does solve your problem, then delete also all bin and obj directories in every project in the solution.
Also had this problem with a migrated project, so I referenced the Microsoft.CSharp dll. In some projects I needed to remove and add again the Reference in the project.
Ran into similar issue in Visual Studio 2017 ASP.Net Core Project. Following steps did the trick for me
Perform Clean Solution
Close VS
Delete .suo file & Delete bin/obj directories
Reopen VS
Similar problem as others, but different resolution. Posting in case I can help someone else.
Running Visual Studio 2017 15.5.2. I use Git and frequently switch branches. Several weeks ago, I started having editors show me errors (all related to types it could not find even though references were valid). Compile worked great. I confirmed the same issue in VS 2017 15.6 Preview (Jan 6, 2018). I would try to delete cache, SUO files, or bin/obj folders and no impact. At first it would appear to work. Reopen Visual Studio and everything would look good. Use "Rebuild Solution" and the IntelliSense errors would returns. I even tried uninstall/reinstall of Visual Studio.
I had the same issue on two machines, both with same version of Visual Studio.
By looking at the errors about missing types, they all appeared to come from two referenced projects. One of those references was a shared project used by just about every other project in the solution, but one of them was a small project without many references. It just so happens that the small project was also referenced by my larger shared project. In Visual Studio, I unloaded the small project and reloaded it. The errors went away! They errors did not come back on Rebuild Solution.
I then switched Git branches and the errors all came back. Fortunately I repeated the above steps of unloading/reloading the small project and the errors went away.
Every time I switch Git branches, the errors come back until I repeat that process. There are zero changes between the Git branches for the smaller project that I unload/reload. Unclear why that sequence is fixing my issue.
Also had this problem (the title, not the specific error message), as well as squiggly lines in the editor. The first squiggly line is under the first #include statement, which names a precompiled header. Intellisense fails to include the precompiled header, but doesn't list that as an error; instead it lists errors further down the file, on code that (very rightfully) relies on declarations in the precompiled header.
The reason Intellisense doesn't find the precompiled header in my environment is that the header named is not an actual file. It doesn't have to be in any other VC or gcc version I used, nor in the 2015 compiler, as long as the precompiled header settings are correctly configured. Apparently not any more for Intellisense. I'm not entirely sure it was different in 2013, maybe I just never noticed.
In the unlikely case that this would be the problem reported here, the solution is simple: create a small file with the pretend-name of the precompiled header, as specified in #include directives, and let that file include the actual name of the precompiled header.
If you wonder... why this distinction between the precompiled header name in the '#include' statement and the actual filename of the precompiled header? Precisely because it guarantees that precompiled header settings are correctly configured. Wherever a precompiled header is "#included", there is no file around that could be included. Either an actually precompiled (binary) version of the actual header is read, or the compilation fails. Obviously, a disadvantage is that it confuses people reading the code, not just Intellisense.
Visual Studio 2017
I have deleted ".suo" file from location .vs\SolutionName\v15.suo
And then restarted Visual studio. This worked for me.
Today I've had similar problem with MSVC++ 2015. I almost gave up and decided to go on without IDE hints, but suddenly I've noticed that stdafx.h of the project i had problems with doesn't contain any standard library headers. I've speculated that inclusion of all standard headers used in the project in stdafx.h might boost up compilation speed, however doing so fixed Intellisense errors as well.
In Visual Studio 2019 the problem is with changing branches with Git when there are NuGet packages installed in the project. What I did to solve this:
Clean Solution
Close Visual Studio
Delete the packages folder
Open Visual Studio
Go to Package Manager
Restore all packages
Recompile
If roslyn is missing, close and open Visual Studio, then recompile.
I had multiple stdfax.h in Additional Include Directories. Make sure the stdafx.h you intended is first in your path.
I had a similar issue with different Visual Studio versions.
Deleting the .suo or .vs folder did not help for me.
The Solution for me was, that I had the Extension StopOnFirstBuildError active. After turning off "Stop build on first error" in the build menu, and after the solution was fully built, the errors shown by Intellisense went away.
I was seeing the intellisearch errors only when publishing a website. (ASP/C# site, VS 2017). They broke the publish. Site ran fine locally.
Cleared the errors by unchecking the setting to pre-compile, and it published fine.
Publish -> Setting -> File Publish Options -> Precompile during publishing
I had this issue with a reference to another project. Removing and re-adding the project reference worked for me.
I can't get intellisense to work. Even if I start with an empty project and add just one file to it with only an include for iostream and an int main() function that prints a char with cout (basically the most basic program), if I try to get intellisense to show anything (say by typing cout.) I get
IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.)
Hours of googling have yielded a couple of articles over at the Microsoft sites that suggest a bunch of things to try or reasons why it wouldn't work. I have tried and eliminated them all, except for one that mentions that stdafx.h has to be in the path.
What is this file?
How do I know if it is in the path if I don't know where it is?
What does it have to do with IntelliSense?
Should I add this file to my project to get it to work?
Thank you.
I got it solved by the Microsoft team at http://connect.microsoft.com/VisualStudio/feedback/details/652838/intellisense-not-creating-ipch-folder
It had to do with a certain Windows Update installed on WinXP. The solution was to install VS2010_SP1 and then a certain update over it.
Look at this question :C++ VS Express 2010 Intellisense
It was solved by pressing CTRL+J .
EDIT: maybe it's the stdafx.h problem !
Add a file stdafx.cpp and a file stdafx.h to the project !
Use #include "stdafx.h" as yhe first line of code in all your .cpp files.
Include all rarely/never changing and frequently used header-files in stdafx.h.
Turn on precompiler-headers in your project and rebuild the project.
(Create a dummy project which have precompiled headers on to see how it's been done)
Do you use the /UseEnv switch when opening visual studio? It breaks Intellisense for c++ projects.
Please find *.sdf file (Intellisence database cache) in project directory and delete it and relaunch project solution this will bring back your intellisence.
There are a couple of threads about similar problems:
click on Help at VS2010 and look for Intellisense.
http://social.msdn.microsoft.com/Search/en-US?query=intellisense%20settings&refinement=123&beta=0&ac=1
http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/75c4cc8d-9a81-4bda-84f0-f619f7493b3b
stdafx.h should be added automatically when you create a New Project.
From the file:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
Just throwing this out there, you are using namespace std? eg:
std::cout.
because intellisense wont work if it doesn't see cout
edit: I over looked that error message so this isn't the case but leaving the answer in case it might help someone down the line.
Maybe it never got installed, have you tried a repair install?, it's worth a shot..
I thought I should mention this:
In Visual Studio 2012 I noticed that Intellisense suddenly stopped working in my C++ project (same error as the poster described). This happened because I had added "DEBUG" as a Preprocessor definition under Project Properties -> C/C++ -> Preprocessor.
Once I removed it from that list and instead put it in the code ( #define DEBUG ) intellisense suddenly started working again.
I don't know why this happens, I just know it screws up my intellisense. I hope this helps someone.
WIN32;_WINDOWS;_DEBUG;Append _DEBUG;
remove Append _DEBUG;
baruch's answer worked for me. for completion, here is also the link to the VS2010-SP1:
http://www.microsoft.com/en-us/download/details.aspx?id=23691
so first installing this and then the hot-fix that baruch referred to solved me the problem, although the whole installation took almost 1:30 hour! (including one restart on my Win-XP machine.)
I know this is an old question, but I had a similar problem IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.). My problem wasn't related with stdafx.h.
To solve my problem, I closed VS2010, deleted the .sdf and .suo files as well as the ipch directory inside the project's main folder.
Then I restarted VS2010, waited for it to build all its metadata again and Intellisense (autocompletion) worked nicely.
EDIT: I am not aware if this "maneuver" has negative side effects.
IntelliSense stores it's data in the SQL Server, which is installed during VS2010 setup. I recommend you check if the SQL Server Service is running.
When I build my C+ project in Visual Studio 2010 using Boost 1.54 and toolset v90, I get a bunch of IntelliSense errors (see image below). My project still builds fine and runs as I'd expect. These errors aren't preventing me from working on my code, but they are really annoying. How do I either fix them or hide them?
I found this post that mentions one of the errors. It suggests that I include <boost/cstdint.hpp>. I tried that but nothing changed. I checked greg_calendar.hpp where the error is happening and it already includes <boost/cstdint.hpp>.
I had the same issue, don't know if this helps but my boost directory resides on D drive (D:/boost to be exact) and my project files also reside on D. My reference to it in the Visual Studio Include Directories was '\boost'. This compiled fine as it was on the same drive but intellisense was still saying I had errors so I changed it to be more explicit (D:\boost) and that fixed it up. Hope this helps anyone in the future.
I was bothered by the error
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
for quite a while, I tried my best to search all the relevant cases but couldn't find a good answer for me.
My situation is, I have a simple piece of code with a couple of dependencies to build, after setting up all the include folders, I'm just experiencing this compiler error all the time. Two weird questions I cannot answer,
There is another win32 console project somebody else set up for this project, working! I'm trying to copy all of his settings (the command line options are exactly the same, all env variables are same, and I run two projects on same visual studio), but just have this 1083 error in my own project.
I was playing around with the settings, one time I changed the platform from Active(Win32) to Win32, then suddenly the compiling works, but after that time I couldn't reproduce it any more.
The thing is, I'm guessing VS in my project might go to a wrong directory
C:\Program Files\Microsoft Visual Studio 8\VC\include instead of C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include
not quite sure, and earlier I was trying to compiling using a building script and make files, same error happened because there people didn't update the correct VS directory.
Sorry I couldn't provide the source code here, and it won't be helpful either since it has a couple of levels of dependency. But I hope based on my description some one might give some idea which direction should I go or spend time on.
iostream.h is deprecated, it should be just iostream:
#include <iostream>
See <iostream> vs. <iostream.h> vs. "iostream.h"
In this version of visual studio (and also in any modern C++ IDE) standard library headers are named without any suffices (iostream instead of iostream.h, string instead of string.h, etc)
Also, C library headers are named like cxxx instead of xxx.h, for example, you should include cstdlib instead of stdlib.h
When you say that you ran your project and the other person's (working) project on the "same visual studio", do you mean the same installation or the same version? If they're not on the same installation, then even if the project settings are copied exactly, it could be that the installation settings are different and that that's what's causing the problem. This may be a long shot, but I'll do my best to explain.
I came across your question because I had a slightly similar problem. Even without dependencies, I couldn't get a simple "Hello, World" program to compile. I used iostream without ".h" as many people suggested and still got C1083. Then I realized that when I installed VS, I unchecked one of the basic features, called "Visual C++ Run-Time Libraries". So I modified the installation to include this feature. Afterwards compilation proceeded successfully and the problem was solved. Is it possible that your installation is missing something that the other person has? If you can get your project to work on this other person's installation, then that might help to pinpoint the problem. Hope this helps. Good luck!
Does a simple hello world program that uses <iostream> compile and run fine?
If so, the Visual Studio system settings are fine and there is something probably wrong in either the project settings or the source.
You can eliminate the source by checking to make sure that the code is actually using #include <iostream> as opposed to #include <iostream.h>. Once that is done, make sure your header search paths point to the right place (the same as the default values in your hello world project for a start)
I can't get intellisense to work. Even if I start with an empty project and add just one file to it with only an include for iostream and an int main() function that prints a char with cout (basically the most basic program), if I try to get intellisense to show anything (say by typing cout.) I get
IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.)
Hours of googling have yielded a couple of articles over at the Microsoft sites that suggest a bunch of things to try or reasons why it wouldn't work. I have tried and eliminated them all, except for one that mentions that stdafx.h has to be in the path.
What is this file?
How do I know if it is in the path if I don't know where it is?
What does it have to do with IntelliSense?
Should I add this file to my project to get it to work?
Thank you.
I got it solved by the Microsoft team at http://connect.microsoft.com/VisualStudio/feedback/details/652838/intellisense-not-creating-ipch-folder
It had to do with a certain Windows Update installed on WinXP. The solution was to install VS2010_SP1 and then a certain update over it.
Look at this question :C++ VS Express 2010 Intellisense
It was solved by pressing CTRL+J .
EDIT: maybe it's the stdafx.h problem !
Add a file stdafx.cpp and a file stdafx.h to the project !
Use #include "stdafx.h" as yhe first line of code in all your .cpp files.
Include all rarely/never changing and frequently used header-files in stdafx.h.
Turn on precompiler-headers in your project and rebuild the project.
(Create a dummy project which have precompiled headers on to see how it's been done)
Do you use the /UseEnv switch when opening visual studio? It breaks Intellisense for c++ projects.
Please find *.sdf file (Intellisence database cache) in project directory and delete it and relaunch project solution this will bring back your intellisence.
There are a couple of threads about similar problems:
click on Help at VS2010 and look for Intellisense.
http://social.msdn.microsoft.com/Search/en-US?query=intellisense%20settings&refinement=123&beta=0&ac=1
http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/75c4cc8d-9a81-4bda-84f0-f619f7493b3b
stdafx.h should be added automatically when you create a New Project.
From the file:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
Just throwing this out there, you are using namespace std? eg:
std::cout.
because intellisense wont work if it doesn't see cout
edit: I over looked that error message so this isn't the case but leaving the answer in case it might help someone down the line.
Maybe it never got installed, have you tried a repair install?, it's worth a shot..
I thought I should mention this:
In Visual Studio 2012 I noticed that Intellisense suddenly stopped working in my C++ project (same error as the poster described). This happened because I had added "DEBUG" as a Preprocessor definition under Project Properties -> C/C++ -> Preprocessor.
Once I removed it from that list and instead put it in the code ( #define DEBUG ) intellisense suddenly started working again.
I don't know why this happens, I just know it screws up my intellisense. I hope this helps someone.
WIN32;_WINDOWS;_DEBUG;Append _DEBUG;
remove Append _DEBUG;
baruch's answer worked for me. for completion, here is also the link to the VS2010-SP1:
http://www.microsoft.com/en-us/download/details.aspx?id=23691
so first installing this and then the hot-fix that baruch referred to solved me the problem, although the whole installation took almost 1:30 hour! (including one restart on my Win-XP machine.)
I know this is an old question, but I had a similar problem IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.). My problem wasn't related with stdafx.h.
To solve my problem, I closed VS2010, deleted the .sdf and .suo files as well as the ipch directory inside the project's main folder.
Then I restarted VS2010, waited for it to build all its metadata again and Intellisense (autocompletion) worked nicely.
EDIT: I am not aware if this "maneuver" has negative side effects.
IntelliSense stores it's data in the SQL Server, which is installed during VS2010 setup. I recommend you check if the SQL Server Service is running.