如何 修改Visual Studio C++ 2015 那些配置的宏
2个回答
展开全部
使用VS2015的时候,有时候要使用一些第三方库,每次需要用到时都要在项目属性里添加相应的include目录和library目录,久而久之觉得有点麻烦。
下列方法可以修改VS2015内置的配置宏$(IncludePath)、$(VC_LibraryPath_x86)、$(VC_LibraryPath_x64),使其包含第三方库的路径,修改好以后新建工程不用再修改项目属性中的Include目录和Library目录。
以boost1.60.0库为例,其路径为d:\boost_1_60_0,针对vs2015编译boost1.60.0库文件,编译后的32位库文件位置为D:\boost_1_60_0\VC2015_lib32,64位库文件位置为D:\boost_1_60_0\VC2015_lib64。
准备工作做好后,打开文件$(VCInstallDir)VCWizards\default.vcxproj,$(VCInstallDir)指VC2015安装目录,在我电脑上路径为D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
则应打开文件D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCWizards\default.vcxproj,其实是个XML文件,在default.vcxproj文件末尾的</Project>之前填加下列内容,保存即可大功告成:
<PropertyGroup>
<IncludePath>d:\boost_1_60_0;$(IncludePath)</IncludePath>
<VC_LibraryPath_x86>d:\boost_1_60_0\VC2015_lib32;$(VC_LibraryPath_x86)</VC_LibraryPath_x86>
<VC_LibraryPath_x64>d:\boost_1_60_0\VC2015_lib64;$(VC_LibraryPath_x64)</VC_LibraryPath_x64>
</PropertyGroup>
下列方法可以修改VS2015内置的配置宏$(IncludePath)、$(VC_LibraryPath_x86)、$(VC_LibraryPath_x64),使其包含第三方库的路径,修改好以后新建工程不用再修改项目属性中的Include目录和Library目录。
以boost1.60.0库为例,其路径为d:\boost_1_60_0,针对vs2015编译boost1.60.0库文件,编译后的32位库文件位置为D:\boost_1_60_0\VC2015_lib32,64位库文件位置为D:\boost_1_60_0\VC2015_lib64。
准备工作做好后,打开文件$(VCInstallDir)VCWizards\default.vcxproj,$(VCInstallDir)指VC2015安装目录,在我电脑上路径为D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
则应打开文件D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCWizards\default.vcxproj,其实是个XML文件,在default.vcxproj文件末尾的</Project>之前填加下列内容,保存即可大功告成:
<PropertyGroup>
<IncludePath>d:\boost_1_60_0;$(IncludePath)</IncludePath>
<VC_LibraryPath_x86>d:\boost_1_60_0\VC2015_lib32;$(VC_LibraryPath_x86)</VC_LibraryPath_x86>
<VC_LibraryPath_x64>d:\boost_1_60_0\VC2015_lib64;$(VC_LibraryPath_x64)</VC_LibraryPath_x64>
</PropertyGroup>
展开全部
Question
0
Sign in to vote
I am building a C/C++ Azure application.
My host system is a Window10 TCP6, with VS2015RC (ver. 14.022823.1) with the Win10 SDK Kit installed.
The C/C++ (win32) application included some standard header file which include the <crtdefs.h>. The CRTDEFS.H inter turn included the <corecrt.h>. This is part of the Azure IoT framework which I cannot change.
Building the app, the VS2015 reported error:
7>c:\program files (x86)\microsoft visual studio 14.0\vc\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
The CRTDEFS.H has:
//
// crtdefs.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Declarations used across the Visual C++ Libraries. The lack of #pragma once
// is deliberate.
//
#include <vcruntime.h>
#include <corecrt.h>
//
The CORECRT.H file is located in "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10069.0\ucrt"
QUESTION:
- Shouldn't the CRTDEFS.H used '#include "corecrt.h"'?
- Or the CORECRT.H file should be part of the default include folder for VS2015?
- Is there a work-around for this? - and moving the corecrt.h to VS2015 is not a fix, I tried.
0
Sign in to vote
I am building a C/C++ Azure application.
My host system is a Window10 TCP6, with VS2015RC (ver. 14.022823.1) with the Win10 SDK Kit installed.
The C/C++ (win32) application included some standard header file which include the <crtdefs.h>. The CRTDEFS.H inter turn included the <corecrt.h>. This is part of the Azure IoT framework which I cannot change.
Building the app, the VS2015 reported error:
7>c:\program files (x86)\microsoft visual studio 14.0\vc\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
The CRTDEFS.H has:
//
// crtdefs.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Declarations used across the Visual C++ Libraries. The lack of #pragma once
// is deliberate.
//
#include <vcruntime.h>
#include <corecrt.h>
//
The CORECRT.H file is located in "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10069.0\ucrt"
QUESTION:
- Shouldn't the CRTDEFS.H used '#include "corecrt.h"'?
- Or the CORECRT.H file should be part of the default include folder for VS2015?
- Is there a work-around for this? - and moving the corecrt.h to VS2015 is not a fix, I tried.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询