##include <iostream> is unrecognized
47 messages · Page 1 of 1 (latest)
When your question is answered use !solved or the button below to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@livid fjord
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\cpp\practice\oparisi\main.cpp).
could not open source file "iostream" (no directories in search list). Please run the 'Select IntelliSense Configuration...' command to locate your system headers.
- show your c_cpp settings
- Does it compile?
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "cl.exe",
"cStandard": "c23",
"cppStandard": "c++26",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}```
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command g++ -g 'D:\cpp\practice\oparisi\main.cpp' -o 'D:\cpp\practice\oparisi/main.exe'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Are you using msys2?
Is that gcc? I use it
I would strongly suggest changing the default terminal from powershell to cmd. It tends to cause issues down the road
also why dont you use VisualStudio instead?
I used Visual studio, but I like vscode more
Open your command prompt and type in where cl.exe. Then paste the output
I think I dont have cl.exe, it answered nothing
Huh. What kind of issues?
How did you install gcc?
if you wish to use cl.exe (msvc) then you need to install MSVC toolchain first and add it to path
At least it shows gcc and g++ versions
Tbh I wouldn't bother with MSVC. Its only redeeming quality is being shipped with VS by default. If I had to choose a compiler, I'd go for Clang
And when I type in cl --version it gives me version
Ok, how did you install them?
If you use github copilot then any command will be in a form of a powershell commands. Which then causes issues as its syntax mixes with cmd prompt making it all crash.
It also has issues by itself with args. Dunno if they fixed it already but I wouldnt bet on that.
Frod VisualStudio build tools 2022
so where cl.exe doesnt show anything but cl --version does...?
Those surely don't ship GCC 😛
What exactly does where cl.exe show?
Just silence
can you send a screenshot?
yet another powershell issue
I have a tutorial on seting up VSC with Clang or GCC here: https://github.com/HolyBlackCat/cpp-tutorials
If you need that
This what I get from x64 Native tools...
Ok. Does gcm cl.exe work in VSC terminal?
----------- ---- ------- ------
Application cl.exe 14.44.3... C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe```
Aha. So it's just where not working in powershell
@limber blaze What were you planning to do with the CL path 😛
Just a habit of checking whenever its in a PATH
but I guess if its in the path then cl.exe is fine
Path is alright. I added every complier and interpretator I need
So you do use msys2
Then my recommendation would be to install mingw-w64-x86_64-clang-tools-extra in it, and install the Clangd extension in VSC. This replaces the stock intellsense with the Clangd one, which should be better in general
And should find your headers out of the box
Ill try this tomorrow and write back here