关于VS中包含库、附加包含库、
转载:https://blog.csdn.net/qing101hua/article/details/53841827
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 : http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.80).aspx
“C/C++ -> General
-> Additional Include Directories”: The directory to be added to the
list of directories searched for include files. More information : http://msdn.microsoft.com/en-us/library/73f9s62w(v=vs.80).aspx
下面这个链接中给出了编译器在编译过程中查找包含目录(Include文件)的顺序:
The compiler searches for directories in the following order:
Directories containing the source file.
Directories specified with the /I option, in the order that CL encounters them.
Directories specified in the INCLUDE 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:
Configuration
Properties => C/C++ => General => Additional Include
directories. Here you list out the "include" directories that you want
searched and made available.Configuration
Properties => Linker => General => Additional Library
directories. Here you list out the "lib" directories that you want to be
searched and made available.Configuration
Properties => Linker => Input => Additional dependencies. Here
you explicitly specify the .lib files that want to include.
就是说我们一般使用C/C++和Linker下面的设置,而一般不建议使用VC++下面的设置
关于VS中包含库、附加包含库、的更多相关文章
- Vs中包含目录、库目录、附加包含目录、附加库目录、附加依赖项之详解
VS项目中的包含目录.库目录.附加包含目录.附加库目录.附加依赖项均在"项目->属性->配置属性"下进行配置,具体说明如下: VC++目录: 包含目录:寻找#inclu ...
- [整理]VS2010中如何添加“依赖","库目录","包含目录"
VS2010中如何添加“依赖","库目录","包含目录" 1. 添加编译所需要(依赖)的 lib 文件[解决方案资源管理器]“项目->属性-&g ...
- (E2E_L2)包含目录、库目录、附加包含目录、附加库目录、附加依赖项之详解【正确的目录添加方法】
VS项目中的包含目录.库目录.附加包含目录.附加库目录.附加依赖项均在"项目->属性->配置属性"下进行配置 一.具体说明如下: 1.VC++目录: 包含目录: ...
- C++ 包含目录、库目录、附加包含目录、附加库目录、附加依赖项之详解(转)
最近因为接触机器学习,所有涉猎到C++方面的开发.在c++中有几个概念很迷糊. VS项目中的包含目录.库目录.附加包含目录.附加库目录.附加依赖项均在"项目->属性->配置属性& ...
- VS2008引入头文件包含目录和lib库目录
全局级别的引入 为VS所有项目设置包含目录和库目录,对所有项目都有效 如下图所示:工具-选项-项目和解决方案-VC++目录-包含文件:在此添加头文件目录即可 工具-选项-项目和解决方案-VC++目录- ...
- 关于vc工程包含多个lib库老是提示无法打开问题
在一个VC项目中,我要包含五个lib库,我在连接器->常规->附加库目录中输入了正确的库包含路径,然后再连接器->输入->附加依赖项中输入:ws2_32.lib;wsock32 ...
- 最全Windows版本jemalloc库(5.2.1)及其使用:包含动态库和静态库、x86版本和x64版本、debug版本和release版本
编写服务器程序时,需要频繁的申请和释放内存,长时间运行会产生大量的内存碎片,这就导致即使当前系统中的闲置内存还足够多,但也无法申请到大的连续可用的内存块,因为此时的物理内存已经千疮百孔像个马蜂窝.此外 ...
- vc下项目的头文件包含目录以及库导入预计库目录设置
1.包含目录:include 头文件包含目录设置: project->setting->C/C++->常规: Additional include directories(附加包含目 ...
- 在VC项目中附加包含目录
1.VC2010项目中附加包含目录 上图项目中附加了两个文件夹,一个是上级目录下的CommonClass,一个是下级目录下的invengo. 使用这两个目录下的类时直接在include后面写头文件名即 ...
随机推荐
- linux VI模式下批量修改文件内容
1. :s/vivian/sky/ 替换当前行第一个 vivian 为 sky :s/vivian/sky/g 替换当前行所有 vivian 为 sky 2. ...
- diamond源码阅读-目录监控
PathNode(Path)StandardWatchEventKind(WatchEvent)Watchable(WatchKey WatchService WatchEvent)WatchKey( ...
- TBSchedule源码阅读1-TBScheduleManagerFactory
TBSchedule 1 TBScheduleManagerFactory 初始化 成员变量 ZKManager; IScheduleDataManager; Schedule ...
- Python 自动化之验证码识别
之前公司的验证码比较简单,可以采取直接破解的方式进行登录 部分代码如下: # -*- coding: utf-8 -*- from selenium import webdriver from sel ...
- Spring Cloud 微服务六:调用链跟踪Spring cloud sleuth +zipkin
前言:随着微服务系统的增加,服务之间的调用关系变得会非常复杂,这给运维以及排查问题带来了很大的麻烦,这时服务调用监控就显得非常重要了.spring cloud sleuth实现了对分布式服务的监控解决 ...
- window下python安装pip
python3.5 1.cmd下运行python -m pip install -U pip 2.Path添加python安装目录下的\Scripts,有pip.exe文件 3.重新打开cmd ...
- Unity框架入门
介绍Unity框架之前,先要说几个概念DIP依赖倒置原则.IOC控制反转.DI依赖注入 DIP是设计原则之一,定义:上层不应该依赖于底层,两者都依赖于抽象: 抽象不依赖于细节,细节应该依赖于抽象. 像 ...
- Python 集合、字典、运算符
先区分一下序列类型和散列类型: 序列类型:list.string.tuple,他们中的元素是有序的. 散列类型:set.dict,他们中的元素无序的. 序列类型有序,可以用索引.而散列类型中的元素是无 ...
- full stack on the road
Full Stack, I'm coming. 有人说全栈只是个理想情况,但我不这么认为,因为好多思想是想通的, 比如 OO.函数式编程.设计模式... 也有人说搞全栈的人样样普通,可是为嘛我在学习j ...
- On the importance of initialization and momentum in deep learning
Ilya Sutskever1 ilyasu@google.com James Martens jmartens@cs.toronto.edu George Dahl gdahl@cs.toronto ...