問題描述
問題:我有一個大型 Visual C++ 項目,我正嘗試將其遷移到 Visual Studio 2010.它包含來自不同來源和不同時代的大量內容.我遇到了問題,因為某些內容同時包含 winsock.h
和 winsock2.h
.
Problem: I have a large Visual C++ project that I'm trying to migrate to Visual Studio 2010. It's a huge mix of stuff from various sources and of various ages. I'm getting problems because something is including both winsock.h
and winsock2.h
.
問題:有哪些工具和技術可以顯示 Visual Studio C++ 源文件的 #include
層次結構?
Question: What tools and techniques are there for displaying the #include
hierarchy for a Visual Studio C++ source file?
我知道 cl/P
用于獲取預處理器輸出,但這并沒有清楚地顯示哪個文件包含哪些其他文件(在這種情況下,/P
輸出是 376,932 行 8-)
I know about cl /P
for getting the preprocessor output, but that doesn't clearly show which file includes which other files (and in this case the /P
output is 376,932 lines long 8-)
在一個完美的世界中,我想要分層顯示哪些文件包含哪些其他文件,以及行號,以便我可以跳轉到源代碼:
In a perfect world I'd like a hierarchical display of which files include which other files, along with line numbers so I can jump into the sources:
source.cpp(1)
windows.h(100)
winsock.h
some_other_thing.h(1234)
winsock2.h
推薦答案
有個設置:
項目設置 -> 配置屬性 -> C/C++ -> 高級 -> 顯示包含
Project Settings -> Configuration Properties -> C/C++ -> Advanced -> Show Includes
這將生成樹.它映射到編譯器開關 /showIncludes
that will generate the tree. It maps to the compiler switch /showIncludes
這篇關于在 Visual Studio 中顯示 C++ 文件的 #include 層次結構的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!