#Error with includepath

48 messages · Page 1 of 1 (latest)

rich isle
#

I'm trying to run a simple C++ file but is getting an error at compile time.

simple zincBOT
#

When your question is answered use !solved 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 run !howto ask.

rich isle
#

Specifically, I'm trying to run

#
#include <iostream>
#

And is getting this error:

#

`#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/name/Documents/Skolearbeid/VScode Personal Projects/Random/c++/Swap.cpp).C/C++(1696)

cannot open source file "wchar.h" (dependency of "iostream")C/C++(1696)`

#

I've tried googling it but I can't get it to work

pulsar lintel
#

what's ur OS?

native sable
#

Did you place the #include "wchar.h" in the your .cpp file ?

#

@rich isle

rich isle
rich isle
#

It looks like this

#

I've tried the quick fixes as well, none of them work

native sable
#

Place your header file under iostream

#

As like #include <iostream>
#include "wchar.h"

rich isle
#

I'm completely new to C++, coming from Java and Python. So I'm a bit slow.

#

Tried it, but same issue

native sable
#

Do u make a header file first ?

pulsar lintel
#

Im not working in macOS so Im not sure if it lost some file, but I found that some ppl have same problem with using macOS

#
#

u can try these

native sable
#

Try to use the visual studiofor c++ instead of visual studio code

rich isle
#

Hmm. Need to look into this a bit more I think.

native sable
#

Which ide r u using ?

rich isle
#

Visual Studio Code

#

I don't have the regular Visual Studio IDE

native sable
#

Use the visual studio @rich isle

rich isle
#

Not at all?

native sable
#

No

rich isle
#

I downloaded an extension on VS Code that was said to support it

#

Why would there be an extension available if it doesn't work?

sly ferry
#

It works, you just need to tell vscode where in your system to find iostream

#

do you have a compiler installed?

#

I dont really know anything bout mac

#

I know its a pain to install g++ in windows compared to linux

#

I'd imagine Mac is about the same as windows

sweet arch
#

mac isn't even close to windows

#

mac is a certified UNIX, so that means it's largely POSIX compliant

#

Windows is zero posix compliant

#

ignoring the abandoned attempt by MS to bring posix to windows

#

generally you should also install the XCode command line tools, likely should also install homebrew. homebrew requires that you install the XCode command line tools

simple zincBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.