I keep getting errors in VSC on programs which work in my IDE Clion. I now tried building a simple program and it still causes errors. Using Mac.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h:119:15: fatal error:
'wchar.h' file not found
#include_next <wchar.h>
1 error generated.
The terminal process terminated with exit code: 1
code hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Please enter your name: ";
string name;
cin >> name;
cout << "Hello, "<< name;
cout << "\n";
return 0;
}
This doesn't build. but the executable file hello works as intended. when I try to build with clang it throws this error.
when I try to use the command g++ hello.cpp
in terminal, it gives this error:
ld: can't write output file: a.out for architecture x86_64
clang:
error: linker command failed with exit code 1 (use -v to see invocation)