We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xmake v2.9.7+master.b029e65ed
windows 11
想使用xmake编译mfc项目,创建一个简单的mfc对话框。 编译项目后,生成的 compile_commands并没有包含atlmfc,导致clangd找不到mfc的基础头文件
添加指定的atlmfc目录后,生成的compile_commands包含atlmfc,使得clangd能找到
补充compile_commands中对mfc的支持
target("MemoryTraversal") add_rules("win.sdk.mfc.static_app") set_kind("binary") add_files("src/*.cpp") add_files("resource/*.rc") add_includedirs("src", "resource") add_deps("PluginManager") add_deps("PluginManager") target_end()
不补充include目录生成出的compile_commands
{ "directory": "e:\\Project\\KernelDrivers", "arguments": ["C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64\\cl.exe", "/c", "/nologo", "/W4", "/O2", "/std:c++20", "/IMemoryTraversal\\src", "/IMemoryTraversal\\resource", "/DUNICODE", "/D_UNICODE", "/DCONTEXT_LOG", "/EHsc", "/utf-8", "/MT", "/DNDEBUG", "/Fobuild\\.objs\\MemoryTraversal\\windows\\x64\\release\\MemoryTraversal\\src\\main.cpp.obj", "MemoryTraversal\\src\\main.cpp", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\km", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt", "-imsvc", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include"], "file": "MemoryTraversal\\src\\main.cpp" }, { "directory": "e:\\Project\\KernelDrivers", "arguments": ["C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64\\cl.exe", "/c", "/nologo", "/W4", "/O2", "/std:c++20", "/IMemoryTraversal\\src", "/IMemoryTraversal\\resource", "/DUNICODE", "/D_UNICODE", "/DCONTEXT_LOG", "/EHsc", "/utf-8", "/MT", "/DNDEBUG", "/Fobuild\\.objs\\MemoryTraversal\\windows\\x64\\release\\MemoryTraversal\\src\\MainDialog.cpp.obj", "MemoryTraversal\\src\\MainDialog.cpp", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\km", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt", "-imsvc", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include"], "file": "MemoryTraversal\\src\\MainDialog.cpp" }
补充include:
add_includedirs("C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\atlmfc\\include")
结果
{ "directory": "e:\\Project\\KernelDrivers", "arguments": ["C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64\\cl.exe", "/c", "/nologo", "/W4", "/O2", "/std:c++20", "/IMemoryTraversal\\src", "/IMemoryTraversal\\resource", "/IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\atlmfc\\include", "/DUNICODE", "/D_UNICODE", "/DCONTEXT_LOG", "/DAFX", "/D_AFXDLL", "/EHsc", "/utf-8", "/MD", "/DNDEBUG", "/Fobuild\\.objs\\MemoryTraversal\\windows\\x64\\release\\MemoryTraversal\\src\\main.cpp.obj", "MemoryTraversal\\src\\main.cpp", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\km", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt", "-imsvc", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include"], "file": "MemoryTraversal\\src\\main.cpp" }, { "directory": "e:\\Project\\KernelDrivers", "arguments": ["C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64\\cl.exe", "/c", "/nologo", "/W4", "/O2", "/std:c++20", "/IMemoryTraversal\\src", "/IMemoryTraversal\\resource", "/IC:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\atlmfc\\include", "/DUNICODE", "/D_UNICODE", "/DCONTEXT_LOG", "/DAFX", "/D_AFXDLL", "/EHsc", "/utf-8", "/MD", "/DNDEBUG", "/Fobuild\\.objs\\MemoryTraversal\\windows\\x64\\release\\MemoryTraversal\\src\\MainDialog.cpp.obj", "MemoryTraversal\\src\\MainDialog.cpp", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\km", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um", "-imsvc", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt", "-imsvc", "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include"], "file": "MemoryTraversal\\src\\MainDialog.cpp" },
The text was updated successfully, but these errors were encountered:
Bot detected the issue body's language is not English, translate it automatically.
Title: The compile_commands generation of mfc is missing, clangd cannot find #include <afxwin.h>
Sorry, something went wrong.
Try it again xmake update -s github:star-hengxing/xmake#cdb
xmake update -s github:star-hengxing/xmake#cdb
thx
No branches or pull requests
Xmake 版本
xmake v2.9.7+master.b029e65ed
操作系统版本和架构
windows 11
描述问题
想使用xmake编译mfc项目,创建一个简单的mfc对话框。
编译项目后,生成的 compile_commands并没有包含atlmfc,导致clangd找不到mfc的基础头文件
添加指定的atlmfc目录后,生成的compile_commands包含atlmfc,使得clangd能找到
期待的结果
补充compile_commands中对mfc的支持
工程配置
附加信息和错误日志
不补充include目录生成出的compile_commands
补充include:
结果
The text was updated successfully, but these errors were encountered: