win11-vscode-wsl2 学习linux源码之linux源码在win11下的编译
1.安裝vscode,及拓展:【c/c++】 【chinese(simplified)】 【git】 【clangd】 【reomte wsl】
(這里主要是想要使用cland提供的引用功能:前提是需要編譯源碼同時(shí)生成commands_compile.json,這樣vscode看代碼可以根據(jù)編譯的文件內(nèi)容來(lái)找到引用)
2.Ubuntu下載,wsl2下載配置
3.下載Linux源碼?The Linux Kernel Archives
4.編譯源碼
安裝編譯的依賴文件
拷貝配置文件
https://github.com/xieyubo/WSL2-Linux-Kernel/blob/wsl-xyb-port-5.11.y/Microsoft/config-wslhttps://github.com/xieyubo/WSL2-Linux-Kernel/blob/wsl-xyb-port-5.11.y/Microsoft/config-wsl編譯
make
生成?compile_commands.json
./scripts/clang-tools/gen_compile_commands.py
其他的參考這個(gè)博主搭建vscode閱讀linux代碼環(huán)境_zf1575192187的博客-CSDN博客_vscode閱讀linux源碼
總結(jié)
以上是生活随笔為你收集整理的win11-vscode-wsl2 学习linux源码之linux源码在win11下的编译的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux工作队列
- 下一篇: MTK平台Android4.4 拍照默认