Clang can't find header includes

I have a program that compiles fine with g++, but using clang++ it seems to choke on standard header files, e.g. "fatal error: 'ostream' file not found".
I came across these SO posts https://stackoverflow.com/questions/60168981 https://stackoverflow.com/questions/26333823, but the answers seem cryptic and related to linux. What could the issue be? How can I find where clang is looking for the standard libraries and why wouldn't they be there?
The standard include should be there. Try to reinstall a recent version of the compiler.
Apparently clang was targeting "i686-pc-windows-msvc". Adding "-target i686-pc-windows-gnu" to the compiler flags AND linker flags seems to have fixed it. Initially when I attempted this I was getting more errors, such as clang looking in the wrong MinGW directory for the header files or other errors. Turns out I hadn't been doing a clean/rebuild after changing the target. Once I did that it started building fine.
Registered users can post here. Sign in or register to post.