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
When attempting to build a project using C++20 modules with the fmt library, xmake fails to find the header file fmt/core.h during the compilation of the mod.mpp module. The error logs indicate that the include path for the fmt library is not properly passed to the compiler, resulting in a fatal error: C1083: Cannot open include file: 'fmt/core.h': No such file or directory. This suggests that the include path for fmt is not being added to the compilation command for the module, even though fmt is correctly required in xmake.lua.
Expected Behavior
The project should compile successfully, and the program should output the formatted string Hello world! as expected.
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.40.33812
checking for zig ... no
checking for zig ... no
checking for nim ... no
checking for nim ... no
checking for git ... ok
checking for gzip ... no
checking for 7z ... C:\xmake\winenv\bin\7z
git rev-parse HEAD
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for xmake::fmt ... fmt 11.0.2
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe
checking for the c++ compiler (cxx) ... cl.exe
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
checking for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe ... ok
checking for flags (cl_scan_dependencies) ... ok
checking for flags (cl_ifc_output) ... ok
[ 0%]: <main> generating.module.deps mod.mpp
checking for flags (-O2) ... ok
checking for flags (-std:c++20) ... ok
checking for flags (-DNDEBUG) ... ok
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe -nologo -O2 -std:c++20 /EHsc -DNDEBUG -TP -scanDependencies build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567\mod.mpp.module.json mod.mpp -ifcOutput build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567 -Fobuild\.objs\main\windows\x64\release\mod.mpp.obj
mod.mpp
mod.mpp(3): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
[ 0%]: <main> generating.module.deps mod.mpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe -nologo -O2 -std:c++20 /EHsc -DNDEBUG -TP -scanDependencies build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567\mod.mpp.module.json mod.mpp -ifcOutput build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567 -Fobuild\.objs\main\windows\x64\release\mod.mpp.obj
mod.mpp
mod.mpp(3): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
error: execv(C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe -nologo -O2 -std:c++20 /EHsc -DNDEBUG -TP -scanDependencies build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567\mod.mpp.module.json mod.mpp -ifcOutput build\.gens\main\windows\x64\release\rules\bmi\cache\modules\2e1fd567 -Fobuild\.objs\main\windows\x64\release\mod.mpp.obj) failed(2)
The text was updated successfully, but these errors were encountered:
Xmake Version
xmake v2.9.5+HEAD.d30de52e9
Operating System Version and Architecture
Windows 10 19045.2846
Describe Bug
When attempting to build a project using C++20 modules with the
fmt
library, xmake fails to find the header filefmt/core.h
during the compilation of themod.mpp
module. The error logs indicate that the include path for thefmt
library is not properly passed to the compiler, resulting in a fatal error:C1083: Cannot open include file: 'fmt/core.h': No such file or directory.
This suggests that the include path forfmt
is not being added to the compilation command for the module, even thoughfmt
is correctly required inxmake.lua
.Expected Behavior
The project should compile successfully, and the program should output the formatted string
Hello world!
as expected.Project Configuration
Additional Information and Error Logs
The text was updated successfully, but these errors were encountered: