
10

使用VS 2017学习Unix V6++源代码
source link: https://zhuanlan.zhihu.com/p/30880063
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用VS 2017学习Unix V6++源代码
同济大学 计算机科学与技术硕士在读
(喜欢用Eclipse的同学请关闭此文章)
首先,你需要一个Visual Studio 2017,勾上用于linux的C++开发

1、找到你的V6++目录,右键,在Visual Studio中打开
也可以在src中打开,毕竟不能makefile2、找到并编辑CppProperties.json
在src中找到include目录,右键复制路径
粘贴到CppProperties.json的include path中去(只用改name为x86-Debug的就行了
以这个为例,把所有的头文件目录都加进去,我后来发现还需要加上 lib下的include跟src,如果不加会找不到头文件,出现红色波浪线错误提示)
然后修改inheritEnvironments以及intelliSenseMode为linux-x86,我的改完就是这样:
{
"configurations": [
{
"inheritEnvironments": [
"linux-x86"
],
"name": "x86-Debug",
"includePath": [
"${env.INCLUDE}",
"D:\\V6++ env\\oos\\src\\include",
"D:\\V6++ env\\oos\\src\\lib\\include",
"D:\\V6++ env\\oos\\src\\lib\\src"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "linux-x86"
}
ctrl+s保存,然后就可以方便地看源码了
转到定义然后就可以直接看函数定义了,VisualStudio的其他基本功能也很强大Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK