Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >VS中C++的包含目录、附加包含目录和库目录和附加库目录的区别

VS中C++的包含目录、附加包含目录和库目录和附加库目录的区别

作者头像
卡尔曼和玻尔兹曼谁曼
发布于 2019-01-22 09:36:42
发布于 2019-01-22 09:36:42
3.2K0
举报

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:

  1. Directories containing the source file.
  2. Directories specified with the /I option, in the order that CL encounters them.
  3. 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:

  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++下面的设置。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015年01月20日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
C++/CLI(二)Mono C++/CLI Native调用和P/Invoke调用
本文根据Mono C++原文档翻译,这篇文章的目的,就是想说CLR程序在VS下面生成的DLL不能给Unity调用,因为Mono的Native调用的编码和MS CLR的不一样,如果Unity想要去调用C++程序,需要使用P/Invoke的方式,这两者的不兼容使得本来非常方便的C++/CLI在Unity下毫无用武之地,希望有一天MS能够给Mono CLR一片土地,方便你我他,还有就是高高兴兴写了半个月MS CLR以为能在Unity下使用了,结果一Run就炸,所以说以后代码未动,单元测试一定要先写啊,这片区代码需要全部重构了,血与泪的教训。
Pulsar-V
2019/04/01
3.8K0
VC++中单元测试
Visual Studio中可以直接进行C++项目的单元测试,下面为自己测试的步骤记录。(测试环境为Visual Studio2013,2012步骤相同)
卡尔曼和玻尔兹曼谁曼
2019/01/25
8970
​11 Building CGAL​
The results of a successful configuration are build files that control the build step. The nature of the build files depends on the generator used during configuration, but in all cases they contain several targets, one per library, and a default global target corresponding to all the libraries.
用户3519280
2023/07/08
3970
win 7 + VC++ 2008 express + OpenCv 2.1.0安装
本文介绍了如何安装配置OpenCV 2.1.0,使用Visual C++ 2008 Express Edition和OpenCV 2.1.0在Windows XP上编写简单的计算机视觉程序。
s1mba
2018/01/03
8730
win 7 + VC++ 2008 express + OpenCv 2.1.0安装
做了Nebula3的应用程序向导
使用方法: 1. 配置环境变量: image.png 2. 把下载的zip解压到一个合适的位置 3. 把N3ConsoleAppWizard.ico, N3ConsoleAppWizard.vsdir, N3ConsoleAppWizard.vsz三个文件拷贝到Visual Studio 8/VC/vcprojects/下, 并更改N3ConsoleAppWizard.vsz中的路径为第2步中的解压路径 4. 打开VS2005, 新建工程就可以看到了 image.png image.png ima
逍遥剑客
2018/06/25
4530
【C++】VS2015/VS2017连接Mysql数据库教程
这是MySQL 数据库服务,下载了它才能在自己的电脑中使用MySQL。 下载页面:Download MySQL Installer 参考教程: windows10上安装mysql(详细步骤) 安装好后,我们打开MySQL 5.7 Command Line Client(在开始菜单的快捷方式里,也可以搜索一下),然后
饶文津
2020/06/02
4.8K0
【C++】VS2015/VS2017连接Mysql数据库教程
vc中关于 directx的配置,和dxsdk_extras(directshow)
Directshow sdk 下载网址 : http://download.microsoft.com/download/d/9/1/d91c44b9-fbac-4e8e-bee1-4a75777923ec/dxsdk_feb2005_extras.exe
全栈程序员站长
2021/12/15
9050
如何在vs中链接vc6的运行时库
是这样,vc6的运行时库有个巨大的好处,就是全系列windows都自带了,而且不用管傻逼的manifest问题。
龙泉寺扫地僧
2019/02/20
1.8K0
新手,Visual Studio 2015 配置Boost库,如何编译和选择,遇到无法打开文件“libboost_thread-vc140-mt-gd-1_63.lib“的解决办法
1,到官网下载最新的boost,www.boost.org 这里我下载的1-63版本. 2,安装,解压后运行bootstrap.bat文件。稍等一小会就OK。 3,编译boost库。注意一定要使用VS2015的x86本机工具命令提示,这个可以在VS2015的安装菜单里面找到。进入命令行提示,输入下面的内容: bjam -j4 --debug-symbols=on --build-type=complete toolset=msvc-14.0 threading=multi runtime-link=shar
用户1177503
2018/02/27
3.2K0
新手,Visual Studio 2015 配置Boost库,如何编译和选择,遇到无法打开文件“libboost_thread-vc140-mt-gd-1_63.lib“的解决办法
GDAL开发环境搭建(VS2010 C++版)
活好多,都没有时间自己搞些自己喜欢的东西。研究生大概也就这样了!不抱怨了,进入正题。
卡尔曼和玻尔兹曼谁曼
2019/01/25
1.1K0
GDAL开发环境搭建(VS2010 C++版)
visual studio静态,动态链接库开发工具简单使用
这里我不会使用visual studio的图形界面工具,作为专业人士,还是搞懂自己的工具是怎么运转的,这样比较好。
byronhe
2021/06/25
1.1K0
CG007蓝宝书opengl宝典源码编译环境的搭建
无法打开包括文件stdio.h ctype.h ucrtd.lib vs2015新版的小问题,这个问题是由于运行时使用的库文件缺少关键文件。
上善若水.夏
2018/09/28
1.9K0
Visual Studio 2008 每日提示(十七)
#161、在解决方案里显示(或不显示)编辑器中打开的文件 原文链接:How to have the Solution Explorer always show (or not show) the file currently opened in the Editor 操作步骤: 菜单:工具+选项+环境+常规,选中“在解决方案管理器中显示活动项”则会在解决方案管理器中高亮显示打开的文件,反之不会显示。 评论:也许你找就用这个功能了,只是没发现罢了 #162、返回Visual C++ 2.0的一些提示 原文
Jianbo
2018/03/01
1.3K0
OpenGL+Visual Studio 2010开发环境搭建
用于OpenGL标准开发的应用程序运行时需有动态链接库opengl32.dll、glu32.dll,这两个文件在安装Windows NT时已自动装载到C:\Windows\System32目录下。OpenGL的图形库函数封装在动态链接库OpenGL32.DLL中,开发基于OpenGL的应用程序
卡尔曼和玻尔兹曼谁曼
2019/01/22
1.4K0
OpenGL+Visual Studio 2010开发环境搭建
12、动态链接库,dll
动态链接库通常都不能直接运行,也不能接收消息。它们是一些独立的文件,其中包含能被可执行程序或其它DLL调用来完成某项工作的函数。只有在其它模块调用动态链接库中的函数时,它才发挥作用。
全栈程序员站长
2022/07/05
8720
12、动态链接库,dll
Pytorch的C++端(libtorch)在Windows中的使用
填一个之前的坑啊,本篇的姊妹篇——利用Pytorch的C++前端(libtorch)读取预训练权重并进行预测 这篇文章中已经说明了如何在Ubuntu系统中使用libtorch做预测,当初也有朋友问我如何在Windows之下尝试使用libtorch,当时因为时间关系没有去看,后来就给忘了…现在有时间了当然要尝试一下~
老潘
2023/10/19
1.2K0
Pytorch的C++端(libtorch)在Windows中的使用
部署Skype for Business Server 2015 数据库SQL 高可用AlwayOn
原文链接:http://blogs.technet.com/b/uclobby/archive/2015/05/08/deploying-sql-server-alwayson-availability-group-for-skype-for-business-server-2015.aspx Deploying SQL Server AlwaysOn Availability Group for Skype for Business Server 2015      In Lync Server 2013, there were requests regarding an alternative to SQL Mirroring for SQL Server High Availability. This was related to the fact that SQL Mirroring was marked as a feature to be removed in future SQL Server versions: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use AlwaysOn Availability Groups instead. in SQL Server 2014 - Database Mirroring (SQL Server) - https://msdn.microsoft.com/en-us/library/ms189852.aspx In Lync Server 2013, it was common to have SQL Server High Availability using SQL Mirroring. The reason for this was that Topology Builder did all the hard work for us. Another supported scenario was to use SQL failover clustering, but in this case we need to manually deploy it: Database software support in Lync Server 2013 https://technet.microsoft.com/en-us/library/gg398990.aspx The good news is Skype for Business Server 2015 comes with AlwaysOn Availability Groups:
杨强生
2019/03/05
8100
部署Skype for Business Server 2015 数据库SQL 高可用AlwayOn
关于C ++:Cmake无法找到Boost库
boostc++cmake Cmake cannot find Boost libraries 我是Cmake的新手,并增强了C ++中的库。 我正在做一个需要boost和Cmake的项目。 我正在使用Cmake版本2.8.11,MS Visual Studio 2013和Boost 1.54.0。 当我尝试从Cmake配置时,出现以下错误:
用户3519280
2023/07/08
1.2K0
BJAM编译
用户3519280
2023/07/08
1600
vs2019编译boost1.55
cd /d D:\Cgal\cmake\boost_1_55_0_vc142 v142,需要修改msvc auto_link
用户3519280
2023/07/08
3130
相关推荐
C++/CLI(二)Mono C++/CLI Native调用和P/Invoke调用
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档