win11-vscode-wsl2 学习linux源码之linux源码在win11下的编译

1.安装vscode,及拓展:【c/c++】 【chinese(simplified)】 【git】 【clangd】 【reomte wsl】

(这里主要是想要使用cland提供的引用功能:前提是需要编译源码同时生成commands_compile.json,这样vscode看代码可以根据编译的文件内容来找到引用)

2.Ubuntu下载,wsl2下载配置

3.下载Linux源码 The Linux Kernel Archives

4.编译源码

安装编译的依赖文件

  1. sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison

拷贝配置文件

https://github.com/xieyubo/WSL2-Linux-Kernel/blob/wsl-xyb-port-5.11.y/Microsoft/config-wslicon-default.png?t=M276https://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

其他的参考这个博主搭建vscode阅读linux代码环境_zf1575192187的博客-CSDN博客_vscode阅读linux源码

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值