VS Code Microsoft C/C++ Extension showing errors on usual includes - visual-studio-code

I have this problem since a couple of hours and I can't fix it :
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\\Bureau\\c++\\2\\tower.cpp).
And i have this message while passing my cursor on this #include <iostream> :
cannot open source file "iostream"
Is there a method to fix this (not just modifying a vscode file every time I open the app) ?
Thanks
Checked that the MINGW path is write and it is good, plus working in bash with --version

I just had to put this path to my includePath, for some reasons it was another one
C:\Program Files (x86)\Microsoft VisualStudio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64

Related

setting up visual studio code for c++, but unable to compile

I have installed visual studio 2019 which works fine for c++ but unable to create folders and sections to store multiple code files. So thought of switching to visual studio code and followed all tutorials available on youtube and documentation. But Visual studio IDE has got nothing showing up when Run Build task is initiated, which is expected to show the c++ extension downloaded. Mingw64 is installed and checked in the terminal too.
no output or terminal opened on Run
compiler installation checked
From the image attached regarding no output in the terminal or terminal opened, it looks like the exe is made because it says 'Build finsihed succesfully'. You'll need to run this executable from the terminal.
For this, if youre in the same directory all you have to do is type the filename. helloworld.exe in the cmd, if its powershell, then ./helloworld.exe. (Also note that for exe files you dont need to explicitly mention .exe at the end of the file name)
The powershell method should work on cmd too.
And if youre not in the same directory as the executable, you can either change directory by typing cd path/to/file and proceed as above, or run directly by typing path/to/file/helloworld.exe. where path/to/file is the directory of your helloworld.exe file

Visual Studio Code Love2D support extension detecting love.app as a directory

I have just started with löve because of an internet course I'm on, and I'm using Visual studio code as my editor. The course recommends that I use the "Love2D Support" extension with Visual Studio. It allows me to run the code directly from VS by pressing Command + L.
Although when I do it, VS outputs me this error:
The setting specified in pixelbyte.love2d.path must be an executable file, not a directory. Check your settings.
The path I have input in the settings is /Users/My_Username/Desktop/love.app
I am 100% sure that it is the correct directory. What is the problem?
Thanks for answering!
The actual executable file in Mac is /Applications/love.app/Contents/MacOS/love so put this in your pixelbyte.love2d.path command in vscode and you are good to go.

Visual Studio Code always uses old version of tsc

I am using typescript as a way of creating javascript for a webpage. My first attempt at using the tsc compiler produced error TS1005 about a missing ';'. This is apparently because Visual Studio Code is using an old version of tsc.
I find I have two versions on my system (discovered using where tsc in a command window):
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
C:\Users\my_user_name\AppData\Roaming\npm\tsc
C:\Users\my_user_name\AppData\Roaming\npm\tsc.cmd
where the first location contains version 1.0.3.0 and the second version 2.7.2.
The only way I can get VS Code to use the latest version is to type the full path, ie
C:\Users\my_user_name\AppData\Roaming\npm\tsc main.ts
into the terminal window. When I do this there are no TS1005 errors.
I would be very grateful if someone could explain in easy terms for a VS Code novice how to set it up so it will automatically pick up the new version of tsc.
Grateful for advice.
I faced the same issue.
However, changing the folder name "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0" to something else other than 1.0 (Example: 1.0.Original) worked for me.

How to open Visual Studio Code from the command line on linux?

I know I can use command "code" to open VS code or file, but I don't know what should I do to make it possible after I install VS code in Ubuntu.Thanks.
Launching from the Command Line
You can launch VS Code from the command line to quickly open a file, folder, or project. Typically, you open VS Code within the context of a folder. We find the best way to do this is to simply type:
code .
Tip: We have instructions for Mac users in our Setup topic that enable you to start VS Code from within a terminal. We add the VS Code executable to the PATH environment variable on Windows and Linux automatically during installation.
Sometimes you will want to open or create a file. If the specified files does not exist, VS Code will create them for you:
code index.html style.css readme.md
Tip: You can have as many file names as you want separated by spaces.
Source: https://code.visualstudio.com/Docs/editor/codebasics
So, there are a couple of solutions for this.
I've linked a video that shows you how to add vscode to $PATH
(which didn't work for me because I couldn't find the "shell:install path" command)
I uninstalled the vscode from my ubuntu and re-installed using sudo snap install --classic code
(This method worked for me)
Tell me which one works for you... and if you have extensions installed to your vscode then i guess you ought to make a backup or something.
Link to the video: https://youtu.be/iP5FKZXtDBs

Debug mex code using visual studio

Hi I have written a mex file and I would like to debug it using visual studio 2010. I followed steps mentioned in Mathwork website :
http://www.mathworks.com/help/matlab/matlab_external/debugging-on-microsoft-windows-platforms.html
I have also read following posts:
how to debug MATLAB .mex32/.mex64 files with Visual Studio 2010
I should mention that I can compile mex with -g code successfully but when I insert the breakpoint it says: the breakpoint cannot be currently hit. No symbols have been loaded for this document.
Then when I run the mex code from Matlab, it does not create any break point and it does not do the debugging.
According to the following :
Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document."
When I go to debug--> windows--> module--> next to matlab says cannot find or open the PDB file. I do not understand what he means when he says
" In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it."
my Matlab is located in C:\Program Files\MATLAB\R2012a
and the mex and pdb file is in C:\Documents\Matlab file but I copied the pdb file (I do not know it is necessary or not) to Matlab workspace. The Matlab current folder that code is running is also C:\Documents\Matlab.
Can anyone please help me to solve this problem.
Can anyone please hel me to solve this problem?