Vscode-docs: clang error c++ on mac in vscode

Created on 26 Jun 2019  路  7Comments  路  Source: microsoft/vscode-docs

Hello, i'm trying to use clang to work with c++ in vscode on my mac and followed every step of the tutorial (https://code.visualstudio.com/docs/cpp/config-clang-mac).

When I build the 'helloworld.cpp' file I get the following errors in my console:

`Executing task: clang++ -std=c++17 -stdlib=libc++ helloworld.cpp -o helloworld.out --debug <

clang: error: no such file or directory: 'helloworld.cpp'
clang: error: no input files
The terminal process terminated with exit code: 1`

C++

Most helpful comment

If you are using vs code and facing this issue which says clang: error: no such file or directory: 'filename'
clang: error: no input files.error while running files

I solved this issue by removing the space or replacing the space with underscore(_)in the filename .extension

Hope this works for you also

All 7 comments

@gitdudek sorry to hear you are having problems. I just verified that the exact instructions work for me. Can you see your helloworld.cpp file in Finder in the expected location?

@mikeblome the '.vscode' directory is hidden but I can see the helloworld.cpp file in my finder as you can see on the screenshot.
screen

@gitdudek thanks for that image! Move helloworld.cpp up one level. Only the .json files should be in the .vscode folder.

@mikeblome thanks a lot. Now it's working.

Found this old thread that helped me with the same problem. Thank you!

Do you happen to know what we're supposed to do if we want to put source files into sub-directories? Is there a way to tell vscode where we've stored .cpp, .lib, .h files?

Me too thanks

If you are using vs code and facing this issue which says clang: error: no such file or directory: 'filename'
clang: error: no input files.error while running files

I solved this issue by removing the space or replacing the space with underscore(_)in the filename .extension

Hope this works for you also

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yohanmishkin picture yohanmishkin  路  6Comments

tbrodbeck picture tbrodbeck  路  4Comments

karrtikr picture karrtikr  路  6Comments

JanKok picture JanKok  路  4Comments

bersbersbers picture bersbersbers  路  6Comments