Module not found in clangd on Windows (Mingw-w64 UCRT) #2655
Unanswered
zHaOdANiuu
asked this question in
Q&A
Replies: 1 comment 6 replies
-
|
How did you install clangd? In previous reports from MSYS2 users, it was found that using the clangd package from MSYS2's package manager works best in this situation. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
msys2 2026-03-22bundle)Problem Summary
import std;is not recognized by clangd, while other modules work correctlyWorkaround: copying
bits/std.ccfrom MinGW include directory to the current project directory makesstdmodule visible to clangd.stdmodule from the standard library.dir
main.cpp
CMakeLists.txt
compile_commands.json
[ { "directory": "D:/home/proj/tests/modules/build", "command": "D:\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\bin\\g++.exe -std=gnu++23 -fmodules-ts -fmodule-mapper=CMakeFiles\\test.dir\\main.cpp.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles\\test.dir\\main.cpp.obj -c D:\\home\\proj\\tests\\modules\\main.cpp", "file": "D:/home/proj/tests/modules/main.cpp", "output": "D:/home/proj/tests/modules/build/CMakeFiles/test.dir/main.cpp.obj" }, { "directory": "D:/home/proj/tests/modules/build", "command": "D:\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\bin\\g++.exe -std=gnu++23 -fmodules-ts -fmodule-mapper=CMakeFiles\\__cmake_cxx_std_23.dir\\D_\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.cc.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles\\__cmake_cxx_std_23.dir\\D_\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.cc.obj -c D:\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.cc", "file": "D:/bin/scoop/apps/msys2/2026-03-22/ucrt64/include/c++/16.1.0/bits/std.cc", "output": "D:/home/proj/tests/modules/build/CMakeFiles/__cmake_cxx_std_23.dir/D_/bin/scoop/apps/msys2/2026-03-22/ucrt64/include/c++/16.1.0/bits/std.cc.obj" }, { "directory": "D:/home/proj/tests/modules/build", "command": "D:\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\bin\\g++.exe -std=gnu++23 -fmodules-ts -fmodule-mapper=CMakeFiles\\__cmake_cxx_std_23.dir\\D_\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.compat.cc.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o CMakeFiles\\__cmake_cxx_std_23.dir\\D_\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.compat.cc.obj -c D:\\bin\\scoop\\apps\\msys2\\2026-03-22\\ucrt64\\include\\c++\\16.1.0\\bits\\std.compat.cc", "file": "D:/bin/scoop/apps/msys2/2026-03-22/ucrt64/include/c++/16.1.0/bits/std.compat.cc", "output": "D:/home/proj/tests/modules/build/CMakeFiles/__cmake_cxx_std_23.dir/D_/bin/scoop/apps/msys2/2026-03-22/ucrt64/include/c++/16.1.0/bits/std.compat.cc.obj" } ].clangd
log
Possibly a path / discovery issue: clangd does not automatically understand that
stdis provided bybits/std.ccin this MinGW environment.Is there a way to properly inform clangd about the location of the
stdmodule under MinGW-w64 UCRT without manually copying system headers into the project?Thank you very much for the great work on clangd + modules support!
Beta Was this translation helpful? Give feedback.
All reactions