You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
Hi
I have a C++ code and when I try to run: clang -O -c filename.cpp
I get:
fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 error generated.
If I try to include the path to iostream like:
clang -O -c filename.cpp -I/riscv-llvm/riscv/_install/riscv64-unknown-elf/include/c++/8.2.0
then I get another file not found:
fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
I found the bit folder to be empty. Do you have any clue on what is happening here?
Thanks
The text was updated successfully, but these errors were encountered:
Here is how I fixed it.
I included c++/9.2.0 and c++/9.2.0/riscv64-unknown-elf with clang++ and able to compile cpp file to binary.
To check if clang++ is using right flags and directories, use -v flag at the end of command line to print verbose trace.
Digging deeper in clang repo, C++ support is not tested. I didn't see any tests with .cpp extension. The fact that you need gnu linker makes me think that C++ feature is seeing the same fate too
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi
I have a C++ code and when I try to run:
clang -O -c filename.cpp
I get:
fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 error generated.
If I try to include the path to iostream like:
clang -O -c filename.cpp -I/riscv-llvm/riscv/_install/riscv64-unknown-elf/include/c++/8.2.0
then I get another file not found:
fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
I found the bit folder to be empty. Do you have any clue on what is happening here?
Thanks
The text was updated successfully, but these errors were encountered: