I installed Microsoft's C++ extension on VSCode, but when I'm writing C++ code,
my screen looks like this.
The autocompletion feature works, but there is no documentation/proper description given to me for any of the built-in C++ functions/classes. Compare the above to what it looks like on an official screenshot of the C++ VSCode extension.
I have my \msys64\mingw64\bin folder added to path too, so there shouldn't be a problem there. Any suggestions on how I can fix the tooltips my IDE gives me for C++?
Related
I use VSCode(code editor, not IDE) for C++ with only Microsoft's C++ extension and today I have encountered a problem here. When I write the wrong syntax, the "PROBLEMS" panel does not show errors. It only shows errors on building the code. Earlier that wasn't the case. How do I fix this ?
Before building:
After building:
I got that error by Disable error squiggles. If you don't reach that error in my case, don't read anymore.
After ignoring, I got your problem:
To fix this, open settings.json file:
Scroll to the end, then set "C_Cpp.errorSquiggles": from Disabled to Enabled.
After reading the question, and the comments, my understanding is that you want Visual Studio Code to tell you when you make a mistake on the sintax, without having to compile the project.
What could be wrong is your C++ IntelliSense, which is odd because it comes in bundle with the C/C++ extension from Microsoft. The extension itself might be disabled, corrupted during an aborted update, or uninstalled.
Have you tried the good old and helpful uninstall and reinstall the extension? That normally fixes my problems with extensions in Visual Studio and VS Code
Note: You have to install the extension first: C/C++ IntelliSense, debugging, and code browsing extension
This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project.
Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select
Project, and then select the correct project that you want to work with.
This will help you see the problems as you create your code without requiring you to run it.
The extension has to know that it is allowed to continuously check your code.
I hope this helps you in the future with other extensions too...
Try and close your current folder and open a different folder. Then come back to your original folder. This worked for me.
I can't compile any c++ code in VS Code. Whenever I try, it throws me to the settings.json file, where I see this:
{
"python.defaultInterpreterPath": "C:\\Users\\Pavel Sankin\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe",
"python.pythonPath": "C:\\Users\\Pavel Sankin\\Anaconda3"
}
and nothing else. I did install the standard C/C++ extension and tried checking out the official website for help, but there seem to be other things there. VS Code doesn't throw any errors, it just opens this file whenever I try to compile any piece of C++ code.
Any help will be much appreciated.
Have you had this problems before?
Have you install the microsoft C++ compiler toolset? (other compiler works fine too; check VS docs)
Did you open VSCode using the Developer Command Prompt?
Also check this and follow the guide.
I am trying to learn SDL in C++ So auto-complete is very essential for me.VS code was working fine with SFML but due to android problems I started learning SDL and now auto-completions for SDL is not working correctly . It always suggest some wrong members ,even If I didn't include any library . I don't have enough experience with VS . I came to VS from neovim only for auto completions which not working properly :(
I had tried restring ,updating and deleting .vscode dir but nothing happened
Hover your cursor on the header file mentioned in the source code
You'll notice a red/green swiggly underline
A light bulb icon appears, click on it
select the option called "edit includepath setting"
It takes you to a new "c_cpp_properties.json"
In this json file, under your platform, add all the paths to the headerfiles
After doing this, most of the unwanted intellisense results disappear. Only releavent ones show up the top.
VS code is a very good tool which comes with source control features. Add C++ extension and a debugger and you are good to go.
I need to write a C++ Windows App to fetch data from a text file stored in a web site (http:.../my.txt) and contains data as follows :
m[mi++]="16.11.12 11:35:00|3366;3448;5352;431|3426;3508;5421;438|3396;3480;5364;443|3515;3598;5560;437|3622;3704;5741;472|3483;3561;5193;442|3454;3536;5464;440|3748;3835;5527;474|3385;3469;5367;436|3326;3413;4800;701;24|8092;8274;12800;688;30"
m[mi++]="19.12.12 11:35:00|3366;3448;5352;431|3426;3508;5421;438|3396;3480;5364;443|3515;3598;5560;437|3622;3704;5741;472|3483;3561;5193;442|3454;3536;5464;440|3748;3835;5527;474|3385;3469;5367;436|3326;3413;4800;701;24|8092;8274;12800;688;30"
I need to read the first 2 inputs of data (start with m[mi++]) each 2 minutes and take the first two parameters from each ones and store it in mySQL table as a script file as follows
Date Data
16.11.12 11:35:00 3366;3448;5352;431
19.12.12 11:35:00 3366;3448;5352;431
Which C++ IDE (not MS visual studio) that is good to use with MySQL without any complication. I tried Netbeans and Eclipse but I've got errors with both MinG and Cygwin
Actually, its not about IDE. Everyting should work almost everywhere (if you have up to date compiller and set things up correctly). I personally use MSVS and mysql++ library. Everything work just fine.
There is no such a thing as IDE for C++ and MySQL development. Just use IDE you want and add libraries correctly. You didnt wrote, what library are you using, so I cant help you more.
I would say that CodeLite (codelite.org) or Code::Blocks (codeblocks.org are decent alternatives. You might need to Checkout wxDevCpp (DevCpp is dead), Anjuta, KDevelop, QT Creator and more.
I personally find MSVS a complicated IDE also I personally believe Eclipse and Netbeans should be used in Java (they Work with C++ both with right plugins)
My personal vote to CodeLite
Qt foreach is giving me sytax error highlight in Eclipse.
I'm programming in C++ using a Qt framework.
I use Eclipse SDK (3.5.2) as my text editor / IDE.
I compile in a console outside of Eclipse using GCC.
When I'm editing my files in Eclipse, I find that Qt's "foreach" is highlighting as a syntax error.
Does anyone know how to fix this? It's not majorly important or anything but it's starting to annoy me. It's as though it's not recognizing the command or something...
If you've enable c++11 support in Eclipse you can redefine 'foreach' to be a range based for loop. In the project properties, select 'Paths and Symbols' in the left pane, then select the 'Symbols' tab. Add a new symbol with 'Name'= foreach(a,b) 'Value'=for(a:b) Select 'Add to all configurations' and 'Add to all languages'
foreach is not a standard C++ keyword. I think the Qt moc compiler transforms this to generated code, like it does with signals/slots in Q_OBJECT tagged classes.
So it's to be expected that Eclipse fails to recognize this.
If you use these Qt-specific features, you're better off using Qt creator.