目录
前言
尝试过使用ubuntu的UI环境+vscode,但最后还是感觉vs顺手。因此开始摸索使用vs连接虚拟机进行开发,调试。而win11有自带的ubuntu虚拟机,由于它的网络,文件路径映射感觉都很省心,因此最终决定使用它,但配置的过程中遇到很多问题,本文仅记录一些过程和问题解决方法,但不是一篇详细安装使用教程。
安装时报错
- 跟着百度的教程,但遇到了挺多问题的
- 报错:WslRegisterDistribution failed with error: 0x8007019e
- 这个是因为未安装Windows子系统支持
- 打开Windows PowerShell(管理员)
- 输入 Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux 并回车执行
- 报错:WslRegisterDistribution failed with error: 0x800701bc
- wsl1升级到wsl2但内核却没有升级
- 下载并安装最新的wsl安装包:wsl_update_x64.msi
- 报错:WslRegisterDistribution failed with error: 0x80041002
- 这个是因为网络配置的问题,可能是因为之前安装过vmware之类的虚拟机,导致安装ubuntu时生成网络适配器出错,因此需要禁用或卸载vmware。
- 但我删完后仍然不行,就先使用了一个退而求其次的办法:设置WSL默认安装版本为1,本来默认安装版本是2,改成1就顺利安装了。
- 控制台命令:
- 查看已安装wsl的信息:wsl -l -v
- 修改默认安装版本为1:wsl --set-default-version 1
- 修改已安装wsl的版本:wsl --set-default-version [wsl名称] [版本]
在linux上需要安装的程序
- 一键安装命令:sudo apt install g++ gdb make ninja-build rsync zip
- 包含的程序:
- g++
- gdb
- make
- ninja-build
- rsync
- zip
VS无法打断点调试
- 正因为安装的是WSL1,后来vs一使用打断点调试就报错,当时就怀疑是这个版本的问题,因此后来就只能直面问题,搞了很多修改,最后还是重装了系统,把网络恢复了,然后就可以直接安装WSL2,但我们已经安装好WSL1版本,因此需要升级就可以了:
- 查看已安装的wsl:wsl -l -v
- 修改其版本为WSL2:wsl --set-default-version Ubuntu-22.04 2
- 注意修改版本的命令后面那个名称Ubuntu-22.04不一定和你的一样,需要你用第一条命令查看想修改的系统的 NAME,如下图:
虚拟机网络适配器导致锐捷不可用
- 由于校园网需要锐捷认证,原本用的是6.84版本,这个版本似乎选不了网卡,当我们安装好虚拟机后,有一个叫 Hyper-V Virtual Ethernet Adapter的虚拟网卡,导致锐捷不知道要选那个网卡使用,然后就认证失败。
- 好在校园网提供了两个版本6.84和4.99,其中4.99是可以选择网卡的。因此就先卸载6.84,然后安装4.99,选择正确的网卡就可以了
ubuntu虚拟机需要安装软件
- 打开ubuntu虚拟机,然后自己决定要不要换apt源让安装软件更快点。
- 并且需要安装软件 gcc,g++,gdb
- 如果项目使用了cmake,vcpkg,同样在ubuntu里也需要安装。
VS中的相关配置
- 选择目标系统:
- 在VS顶部有一个下拉栏可以选择目标系统,如图就是选择上面安装的WSL-Ubuntu
- -
- 如果没有,就点击右边的小箭头,然后勾选 目标系统:
- 选择编译配置:
- 主要是选择编译器和debug/release
- 同样是在VS的顶部,如果没有,则按照上一步里勾选 “配置”
- 一开始很可能是没有如图的这个配置的,这个需要我们添加
- -
- 添加方法:
- 点击 “配置” 下拉栏 -> 管理配置 -> 如图点击 + 号
- -
- 然后它会有一个弹窗,往下滑动就会出现WSL-GCC-Debug和WSL-GCC-Release,两个都添加进来就可以了:
buy cheap doxycycline doxycycline medication doxycycline hyclate
I highly advise to avoid this site. The experience I had with it was nothing but dismay and concerns regarding fraudulent activities. Be extremely cautious, or even better, look for a more reputable site to fulfill your requirements.
I urge you steer clear of this platform. My personal experience with it was nothing but frustration and suspicion of scamming practices. Exercise extreme caution, or alternatively, find an honest site to meet your needs.
ciprofloxacin generic: ciprofloxacin order online – cipro 500mg best prices
I urge you steer clear of this platform. My personal experience with it has been only frustration and concerns regarding scamming practices. Proceed with extreme caution, or alternatively, seek out a trustworthy site for your needs.
I urge you steer clear of this site. My personal experience with it was only disappointment as well as concerns regarding scamming practices. Proceed with extreme caution, or better yet, look for a more reputable platform to fulfill your requirements.
ciprofloxacin generic: buy ciprofloxacin over the counter – buy ciprofloxacin over the counter
doxycycline online: generic doxycycline – doxycycline mono
diflucan 200 mg diflucan cream prescription diflucan 150 mg capsule
doxycycline order online: doxylin – doxycycline order online
I highly advise steer clear of this site. My personal experience with it has been purely dismay as well as concerns regarding fraudulent activities. Proceed with extreme caution, or alternatively, look for a more reputable platform to fulfill your requirements.
I strongly recommend to avoid this platform. The experience I had with it was only dismay and concerns regarding fraudulent activities. Proceed with extreme caution, or better yet, seek out an honest platform for your needs.
order cytotec online п»їcytotec pills online cytotec buy online usa
I highly advise steer clear of this site. My personal experience with it was only disappointment and suspicion of fraudulent activities. Exercise extreme caution, or even better, look for a trustworthy site to fulfill your requirements.
https://doxycyclinest.pro/# buy doxycycline without prescription
tamoxifen lawsuit: tamoxifen headache – nolvadex gynecomastia
diflucan 150 mg price in india: how to get diflucan otc – where can you get diflucan
can you buy diflucan over the counter diflucan over the counter pill diflucan 100
ciprofloxacin 500mg buy online: buy generic ciprofloxacin – ciprofloxacin
ciprofloxacin 500mg buy online: where can i buy cipro online – cipro 500mg best prices
I highly advise to avoid this platform. My own encounter with it has been nothing but frustration along with concerns regarding fraudulent activities. Exercise extreme caution, or better yet, find a more reputable site to fulfill your requirements.
I highly advise to avoid this site. The experience I had with it was purely disappointment as well as suspicion of scamming practices. Exercise extreme caution, or even better, find a more reputable service to meet your needs.
dcis tamoxifen: nolvadex pct – raloxifene vs tamoxifen
buy cytotec pills online cheap Cytotec 200mcg price buy cytotec pills
diflucan 1140: where to get diflucan otc – price of diflucan in south africa
tamoxifen benefits: tamoxifen lawsuit – nolvadex vs clomid
buy doxycycline hyclate 100mg without a rx order doxycycline 100mg without prescription doxycycline 50mg
ciprofloxacin generic price: cipro online no prescription in the usa – cipro ciprofloxacin
https://doxycyclinest.pro/# doxycycline without prescription
diflucan 200mg: diflucan 200 mg price – diflucan rx price
where can i buy nolvadex: tamoxifen cancer – tamoxifen alternatives premenopausal
buy cipro online canada where can i buy cipro online purchase cipro
Заказать контейнер для строительного мусора ecologia-t.ru
По вопросу контейнер 27 м3 цена вывоз мусора Вы на верном пути. Вывозим отходы любого вида: строительный, твердые коммунальные отходы, металлолом, порубочные остатки, снег и подобные. Также работаем 24 часа в сутки, без выходных и даже в праздничные дни. Делаем как одноразовые вывозы, так и регулярные по конкретным дням или часам, в зависимости от задачи заказчика. Подходим к любой проблеме персонально, чтобы реализовывать работу супер внушительно.
buy misoprostol over the counter: buy misoprostol over the counter – buy cytotec online fast delivery
purchase cytotec buy misoprostol over the counter buy cytotec pills online cheap
Заказ мусорного контейнера ecologia-t.ru
Относительно вывоз мусора газель москва мы Вам поможем в настоящий момент. Звоните по контактному номеру телефона 8(495)506-26-76 или закажите обратный и мы Вам сразу перезвоним. Мы находимся по адресу: 109382, г. Москва, ул. Краснодонская, д. 46. Подробный прайс лист Вы сможете найти на следующем сайте ecologia-t.ru и зависит от нескольких факторов. Конкретно: тип мусора, объем контейнера и необходимая грузоподъемность транспорта. Итоговая цена будет высчитана после созвона с нашим специалистом. Звоните и быстрее заполняйте заявку на вывоз мусора в Москве.
https://indianpharmgrx.com/# Online medicine home delivery
northwest canadian pharmacy: Canadian pharmacy prices – my canadian pharmacy reviews
purple pharmacy mexico price list п»їbest mexican online pharmacies medicine in mexico pharmacies
http://canadianpharmgrx.com/# canadian pharmacy 24h com safe
canadian mail order pharmacy: CIPA approved pharmacies – pharmacy canadian superstore
http://indianpharmgrx.shop/# legitimate online pharmacies india
pharmacy website india indian pharmacy delivery reputable indian pharmacies
Вывоз мусора недорого Москва ecologia-t.ru
По поиску вывоз мусора контейнером 20 м3 Московская область Вы на нужном пути. Вывозим отходы разного вида: смешанные отходы, твердые коммунальные отходы, вторсырье, порубочные остатки, снег и подобные. Также работаем 24 часа в сутки, без выходных и даже в праздничные дни. Делаем как одноразовые вывозы, так и постоянные по определенным дням или часам, в зависимости от целей клиента. Подходим к каждой проблеме индивидуально, чтобы реализовывать работу максимально внушительно.
medicine in mexico pharmacies: mexico drug stores pharmacies – mexican drugstore online
Incredible! I just read your post and I’m absolutely amazed. Your perspective on this topic is spot-on. I’ve gained a new perspective and can’t wait to see what you write next. Your work is inspiring!
Incredible! I just read your post and I’m blown away. Your perspective on this topic is incredibly insightful. I’ve gained a new perspective and can’t wait to see your next post. Your work is inspiring!
https://indianpharmgrx.com/# mail order pharmacy india
п»їlegitimate online pharmacies india Healthcare and medicines from India india pharmacy mail order
pharmacies in mexico that ship to usa: п»їbest mexican online pharmacies – best online pharmacies in mexico