Visual studio intellisense for headers without .h

我是研究僧i 提交于 2019-12-31 20:30:49

问题


I am using a library that has headers without the .h
This defeats visual studio's intellisense (declaration/definition lookup)

Anyone know how to tell VS2008 that a file is a header?


回答1:


Go to Tools::Options::Text Editor::File Extension tab in Visual Studio. Check the "Map extensionless headers" checkbox, and select the language you want from the combobox.




回答2:


I'd hazard a guess that you should ensure the headers are included from a source file (usually a .cpp file).

Where the properties for the source file have the Tool property set to C/C++ Compiler Tool. I would guess Intellisense starts with them, and would follow #includes to files regardless of their extension to build its database of symbols from anything it encounters.



来源:https://stackoverflow.com/questions/210247/visual-studio-intellisense-for-headers-without-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!