Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

fatal error: 'iostream' file not found #1

Open
lorenzoditucci opened this issue Mar 7, 2019 · 1 comment
Open

fatal error: 'iostream' file not found #1

lorenzoditucci opened this issue Mar 7, 2019 · 1 comment

Comments

@lorenzoditucci
Copy link

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

@aditya4d
Copy link

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 free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants