探索flutter框架开发的app在移动应用市场的潜力与挑战
1248
2022-10-11
VS中C++的包含目录、附加包含目录和库目录和附加库目录的区别
对Visual Studio中C++的包含目录、附加包含目录和库目录和附加库目录的区别不是很清楚,参考别人的文章整理出来的。供大家分享学习!
Visual Studio C++工程中,右键一个Project,可以发现有两个地方设置Include的相关目录:
1. VC++ Directories -> Include Directories 2. C/C++ -> General -> Additional Include Directories
MSDN上的解释如下:
“VC++ Directories -> Include Directories” : Directory settings displayed in the window are the directories that Visual Studio will search for include files referred to in your source code files. Corresponds to environment variable INCLUDE. More information : -> General -> Additional Include Directories”: The directory to be added to the list of directories searched for include files. More information : compiler searches for directories in the following order:1. Directories containing the source file.2. Directories specified with the/I option, in the order that CL encounters them.3. Directories specified in theINCLUDE environment variable.
其中Order2中的/I是由C/C++ -> General -> Additional Include Directories设置的。
而Order3中的INCLUDE是由VC++ Directories -> Include Directories设置的。
同理,
1. VC++ Directories -> LibraryDirectories 2. Linker -> General -> Additional Library Directories
也一样。
所以在VS中开发C++程序,我们一般是这样设置的:
In C++, you got the header files (.h), the (.lib) files and the (.dll) files.In Visual Studio, you provide the location to search for these files in three different places:1. Configuration Properties => C/C++ => General => Additional Include directories. Here you list out the "include" directories that you want searched and made available.2. Configuration Properties => Linker => General => Additional Library directories. Here you list out the "lib" directories that you want to be searched and made available.3. Configuration Properties => Linker => Input => Additional dependencies. Here you explicitly specify the .lib files that want to include.
就是说我们一般使用C/C++和Linker下面的设置,而一般不建议使用VC++下面的设置。
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~