Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 21 days ago.
Improve this question
I created an empty C++ project to do some c++ training
I get this error as I build, so I want to upgrade my compiler to latest or at least 17
error C7529: multiple using-declarators require at least '/std:c++17'
I just cannot find the regular compiler options window/ui
I looked everywhere, all I get is some sort of JSON config file
{
"configurations": [
{
"inheritEnvironments": [
"msvc_x64"
],
"name": "x64-Debug",
"includePath": [
"${env.INCLUDE}",
"${workspaceRoot}\\**"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "windows-msvc-x64"
}
]
}
thanks for your help on this
[edit]
vs start
vs2022
vs2022 about
ok figured it out. I opened the folder instead of the solution. my bad
select open solution, not open folder
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 days ago.
Improve this question
I'm a beginner to OpenCv with C++ and I'm using VS Code in Ubuntu 20.04. When I open the VS code there are 0 errors but when I compile it underlines the opencv library. I'm guessing something is wrong with VS Code because I can run my code with Cmake. My c_cpp_properties.json and some pictures are below:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/opencv4/"
],
"defines": [],
"compilerPath": "/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-arm",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
I used "ls" command to see "usr/local/include/opencv4/opencv2"s inside.
usr/local/include/opencv4/opencv2$ ls
calib3d features2d highgui.hpp objdetect
calib3d.hpp features2d.hpp imgcodecs objdetect.hpp
core flann imgcodecs.hpp opencv.hpp
core.hpp flann.hpp imgproc opencv_modules.hpp
cvconfig.h gapi imgproc.hpp photo
dnn gapi.hpp ml photo.hpp
dnn.hpp highgui ml.hpp stitching
This before when I run the code.
This is after...
I'm wondering why it underlines the library. Can you help me?
I am using VSCode on Ubuntu 20.04.
The errors, "Connection to server got closed. Server will not be restarted." and "The language server crashed 5 times in the last 3 minutes. It will not be restarted." are popping up again and again for a reason that I cannot figure out:
So far, I have done the following:
Restarted VSCode
Restarted my PC
Opened VSCode by going to that specific folder in the file explorer, right-clicking and selecting open in terminal, and typing "code ."
Uninstalling and reinstalling the C/C++ Extension
Downgrading the C++ extnsion
Using the pre-release C++ extension
Modifying the c_cpp_properties.json
Here is my current c_cpp_properties.json:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
Does anyone have any idea why this could be happening and/or how it could be fixed?
I modified the configurations of my C/C++ extension on VS Code. I'm trying to use wxWidgets on my Mac (M1 2020) with the normal x86 version of VS Code (C/C++ IntelliSense doesn't work on ARM). The folder I want to include is in my home folder.
Here's how my config file looks now:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"/Users/mario/wxWidgets/include"
],
"defines": [],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang++",
"cStandard": "c11",
"cppStandard": "c++98",
"intelliSenseMode": "macos-clang-arm64"
}
],
"version": 4
}
Now, I get two errors in my include statement:
Update includePath
Unable to open error code "wx/setup.h" of the origin file (dependency of "wx/wx.h")
The IncludePath should contain everything that's needed for that include statement to work, so I have no idea why it's throwing an error. Can anyone help me? I'm pretty new to coding GUIs with external frameworks so I'm confused. Thanks :)
I am doing remote development on a Linux machine using VSCode Remote-SSH. I have installed the C/C++ extension on the remote machine via VSCode. Most code does get syntax highlighting correct but I noticed some issues.
C structures are not colored at all.
Funny thing is the colors work when I ctrl+click to go to the structure.
This is really bothering me. Why do these structures not get colored like they do when I do local development on my windows machine?
Here is my c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}",
"${workspaceFolder}/../../dwcore/dwcore",
"${workspaceFolder}/../../dwcore/ilsutil",
"${workspaceFolder}/../../dwcore/ilslog"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"compilerArgs": [],
"browse": {
"path": [
"${workspaceFolder}/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
Unfortunately, enhanced colorization does not seem to be supported with remote development at the moment according to a discussion on the following issue: https://github.com/microsoft/vscode-cpptools/issues/4569
Enhanced colorization does not currently work via remoting, as we don't have access to the current Theme's files to look up colors.
This means that usual syntax highlighting based on grammar will work, as in typedef struct mystruct where the function of all token can be determined based only on the surrounding context, but advanced highlighting that requires more knowledge that needs to be provided by intellisense will not.
Note that intellisense overall work with remote development and ctrl+click will show you the corresponding definition, which is correctly colored based on grammar.
This was fixed since cpptools version 0.29.0
You can see it in the changelog here:
https://github.com/microsoft/vscode-cpptools/releases/tag/0.29.0
There its written:
Switch to using the VS Code Semantic Tokens API for semantic colorization (works with remoting). PR #5401, #3932, #3933, #3942
Update your extension and it should work now without problems
In my computer c_cpp_properties.json file looks like this,
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
Is the compilerPath and intelliSenseMode are correct ?
or compilerPath should be something like this
C:\MinGW\lib\gcc\mingw32\6.3.0\include\c++
or
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/g++.exe",
also intelliSenseMode should be "gcc-x64", or "clang-x64" or "msvc-x64" ?
For instance in Microsoft Vs Code site above code changed to
{
"configurations": [
{
"name": "Win32",
"defines": [
"_DEBUG",
"UNICODE"
],
"compilerPath": "C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/g++.exe",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
https://code.visualstudio.com/docs/cpp/config-mingw#_configure-the-compiler-path
So the main problem is how can I be sure about the what to use in compilePath
Thanks
To answer your question, in the official Visual Code documentation, you can see that the compiler path and intelliSenseMode are set as shown below. Just make sure to give the right location of g++.exe.
"compilerPath": "C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/g++.exe",
"intelliSenseMode": "gcc-x64"
Update the question with what issues you are noticing if you have any.
The compilerPath and intelliSenseMode variables serve the purpose of configuring the VSCode editor to provide compilation and IntelliSense services respectively.
compilerPath
Because VSCode isn't a full IDE by itself, it doesn't ship with the compiler it needs to offer the compilation service. Therefore, it needs to be pointed in the direction of a valid C++ compiler. That is the purpose of the compilerPath variable. Testing whether or not the path you provided is correct is easy. Copy and paste it into a terminal (CMD or PowerShell) and see if the resulting output looks something like this:
PS C:\Users\neilb> C:\"Program Files"\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe
g++.exe: fatal error: no input files
compilation terminated.
PS C:\Users\neilb>
This means that the path is valid. If it isn't, locate where your install of MinGW (the library that provides gcc and g++ support on Windows) is. If not already installed, do so.
inteliSenseMode
This tells VSCode what C++ style guide to follow for formatting code and providing linting features. The full list of options here is listed on the VSCode-cpptools GitHub page. What you have currently set should be adequate. (clang-x64)