MINGW-packages: after most recent update clang++ cannot find standard library include files

After most recent update my build script fails when trying to include standard c++ library files.

$ clang --version clang version 13.0.1 Target: x86_64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/clang64/bin

Here is the simple c++ program saved in hello_world.cpp file.

#include <iostream>
int main( void )
{
    std::cout << "Hello world" << std::endl;
    return( 0 );
}

When I try to compile it I get the following:

$ clang++ -Wall -o hello_world.o hello_world.cpp
hello_world.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
1 error generated.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 22 (7 by maintainers)

Most upvoted comments

Thanks. I’ll update again to the latest version that is not working for me and run this (and look whether those standard c++ library files are in on of the locations printed by that command - if I still can’t figure it out at least now I know how to downgrade again).

I encountered this problem, when installing ucrt or other versions of GCC, it seems that clang cannot find the standard library.I try to install mingw-w64-clang-x86_64-gcc-compat and it solved.