当前位置:网站首页>WSL+Valgrind+Clion
WSL+Valgrind+Clion
2022-07-28 15:28:00 【saddlesad】
记录一下搭建WSL工具链以使用valgrind的过程
网络上没有针对clion在windows下使用valgrind的中文教程,jetbrains官方的教程也比较含糊,在此写下整个过程和参考的网页教程,woc写完了才发现有教程的https://blog.csdn.net/u010606602/article/details/80782650。
安装WSL作为valgrind的桥,使得在windows下也能运行valgrind等linux专属的工具。
- 首先要修改镜像源,这个比较简单而且它是根据系统而异的,大体路径就是先cp保存/etc/apt/sources.list,然后删除全部内容再手动添加国内的sources,添加完后要使用
sudo apt-get update;sudo apt-get upgrade;sudo apt-get install build-essential。如果第三个命令出现问题,那么应该是依赖broken的问题,建议直接重装wsl。安装完基础环境后需要再手动安装valgrind和cmake工具,前者直接sudo apt-get即可,后者或许需要源码安装(https://www.linuxidc.com/Linux/2018-09/154165.htm)。 - 之后就可以打开clion,在Setting->Build,Execution,Deployment->Toolchains中新建一个WSL类型的工具链,会自动导入Environment,但是Credentials需要手动设置,这需要wsl提前打开ssh,参照https://www.cnblogs.com/mydailycoding/p/12375273.html,成功连接就会显示Connected。

- 这是一个比较官方的流程,但是我没有找到视频中的sh脚本出处,所以只是参考了他的思路,但没有按照他的做法来:evget.com/video/2616
- 现在以及完成了wsl环境的配置和安装,但是还有问题:
- 直接运行valgrind会显示 cound not found executable valgrind,需要手动添加路径,直接找到子系统在windows下的根目录添加即可C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\bin
- 如果安装了boost库,那么使用wsl作为工具链时他是找不到的,可以在cmakelists.txt文件中直接引用依赖库(得益于wsl中的/mnt目录)include_directories(/mnt/e/boost_1_73_0)定位到windows系统下的boost库文件就好了。
边栏推荐
猜你喜欢

Basic structure and operation principle of solar street lamp

小程序中的分页查询
![[Multisim Simulation] LM339 zero crossing circuit simulation](/img/ca/f6dae5fd298c00570407c2bdfa5118.png)
[Multisim Simulation] LM339 zero crossing circuit simulation

Zhengda cup hacker marathon data analysis competition

The video Number finds the golden key, and Tiktok imitates the latecomers

About standard IO buffers

HyperMesh自动保存(增强版)插件使用说明

HyperMesh运行脚本文件的几种方法

排序1-插入排序与希尔排序

视频号找到金钥匙,抖音模仿后来人
随机推荐
Geodetic coordinate system to Martian coordinate system
Roson的Qt之旅#102 ListModel
ANSA二次开发 - Apps和ANSA插件管理
KubeEdge发布云原生边缘计算威胁模型及安全防护技术白皮书
R language ggplot2 visually draws line plots, and uses gghighlight package to highlight the lines that meet the combination judgment conditions in the line graphs (satisfies both condition a and b)
使用js直传oss阿里云存储文件,解决大文件上传服务器限制
R语言使用fs包的file_delete函数删除指定文件夹下的指定文件、举一反三、dir_delete函数、link_delete函数可以用来删除文件夹和超链接
KubeEdge发布云原生边缘计算威胁模型及安全防护技术白皮书
解决电脑恶意广告弹窗的思路
Practical development tutorial of software problem repair tracking system (Part 1)
CoDeSys realizes bubble sorting
Brief tutorial for soft exam system architecture designer | software debugging
Redis系列4:高可用之Sentinel(哨兵模式)
学会使用MySQL的Explain执行计划,SQL性能调优从此不再困难
PHP about problems such as memory overflow timeout caused by large amount of data exporting or traversing data
Thoughts on solving the pop-up of malicious computer advertisements
Reentrant and non reentrant
Li Hongyi, machine learning 4. Deep learning
8051 series MCU firmware upgrade IAP
Record doc