前段时间我贴了一篇vs2010批量编译vc6~vs2008的ARX版本,实际上那一篇是我在研究vs2010编译v110,v140平台的附带收获,正应了那句话,有心栽花花不开,无心插柳柳成荫,因为vs2010编译更高版本的ARX目前需要的平台集是v110(vs2012,2013)和v140(vs2015,2017),分别对应CAD的R20(cad2015,2016),R21(cad2017,2018),而WindowsXp仅仅支持vs2010,所以必须使用win7以及以上的系统才能实现批量编译。

准备vs2012,vs2015绿色便携版,或者安装版。

绿色便携版下载地址,vs绿色便携版下载

下面我们来提取编译器,实际上vs开发工具集成编译环境IDE包含编辑器和编译器,而我们仅仅需要vc编译器+必要的windows SDK即可实现编译,

1,打开便携版目录,我们主要关心这两个文件夹。

先打开common7\IDE

找到以下4个文件,右键复制

进去VC\bin目录,粘贴,如果提示重复,可以跳过不覆盖。

在这个文件夹下面运行以下cl.exe,link.exe等exe,看是否能运行,可以打开cmd运行拖动exe到cmd中执行。。。。

已经能够提示用法,表示这个exe程序可以正常执行,其他的一样的可以测试一下。

下面我们为vs2010添加新的平台集,v140

打开如下路径

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets

新建两个文件夹,v140,v110

进入v90,选择这两个文件复制到v140,v110

粘贴到v140后,修改这两个文件的名字v90改v140

然后用记事本或者notepad++打开这两个文件。

替换所有v90文本为v140

找到这个文件的第一个<VCInstallDir>

将目录改成你的vs2015的vc目录,如:E:\Visual Studio 2015 Enterprise\VC\ ,注意最后的斜杠。

我这个文件后面还有一个 <VCInstallDir Condition="'$(VCInstallDir)' == ''">d:\vc\vc9\</VCInstallDir> 这句可以不要,可以删除。。

按照上次的例子添加相关项目,如图。

现在我们可以用vs2010新建一个项目测试测试,看看有什么问题。。

更改项目平台为v140

直接编译。

用everything搜索一下。

这个是我win10系统下的目录,因为我这台电脑上没有安装vs2015相关的windwos SDK,所以无法找到这个文件。。

所以必须找到一份windws10的SDK,因为我已经有了,我就不去折腾了,自行百度解决吧。而且这个文件夹有1.78G,不好上传。

回归主题,继续编辑Microsoft.Cpp.X64.v140 这个文件,找到第一个<WindowsSdkDir 后面的路径改为winsows10 SDK的路径如。

G:\Program Files (x86)\Windows Kits\10

再次编译。

这个是winver版本设置低了的缘故。打开项目文件的stdafx.h

替换一下

#if _MSC_VER < 1300
#define WINVER 0x0400
#elif _MSC_VER > 1500 // vc9
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0501 // Change this to the appropriate value to target Windows Me or later.
#endif #ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0601 // Change this to the appropriate value to target IE 5.0 or later.
#endif
#else
//- Modify the following defines if you have to target a platform prior to the ones specified below.
//- Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER //- Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400 //- Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif #ifndef _WIN32_WINNT //- Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400 //- Change this to the appropriate value to target Windows 2000 or later.
#endif #ifndef _WIN32_WINDOWS //- Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 //- Change this to the appropriate value to target Windows Me or later.
#endif #ifndef _WIN32_IE //- Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400 //- Change this to the appropriate value to target IE 5.0 or later.
#endif
#endif

  

再次编译

启动调试

测试一下断点。

正常。。

至此,v140x64编辑完成,同样的方式,win32,v110都是类似的。。不再重复。。

附 上完整的x64 prop文件,仅供参考。

<!--
***********************************************************************************************
Microsoft.Cpp.x64.v140.props WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE. Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
--> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Platforms\x64\PlatformToolsets\v140\ImportBefore\*.props" Condition="Exists('$(VCTargetsPath)\Platforms\x64\PlatformToolsets\v140\ImportBefore')" /> <PropertyGroup>
<PlatformToolsetVersion>90</PlatformToolsetVersion> <VSInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)</VSInstallDir>
<VSInstallDir Condition="'$(VSInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\VS@ProductDir)</VSInstallDir>
<VSInstallDir Condition="'$(VSInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)</VSInstallDir>
<VSInstallDir Condition="'$(VSInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\10.0\Setup\VS@ProductDir)</VSInstallDir> <VCInstallDir>E:\Visual Studio 2015 Enterprise\VC\</VCInstallDir>
<MyARXDir>C:\ObjectARX 2017\</MyARXDir>
<MyPlatform>x64</MyPlatform> <WindowsSdkDir Condition="'$(WindowsSdkDir)' == ''">G:\Program Files (x86)\Windows Kits\10\</WindowsSdkDir> <FrameworkDir Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>
<FrameworkDir Condition="'$(FrameworkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)</FrameworkDir> <FrameworkSdkDir Condition="'$(UseEnv)' != 'true'">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A@InstallationFolder)</FrameworkSdkDir>
<FrameworkSdkDir Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</FrameworkSdkDir>
<FrameworkSdkDir Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v6.0A@InstallationFolder)</FrameworkSdkDir>
<FrameworkSdkDir Condition="'$(FrameworkSdkDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</FrameworkSdkDir> <FrameworkVersion Condition="'$(UseEnv)' != 'true'">v2.0.50727</FrameworkVersion>
<Framework35Version Condition="'$(UseEnv)' != 'true'">v3.5</Framework35Version> <ExecutablePath Condition="'$(ExecutablePath)' == ''">$(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkSDKDir)lib\win64;$(FrameworkDir)$(FrameworkVersion);$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath Condition="'$(IncludePath)' == ''">$(WindowsSdkDir)Include\10.0.15063.0\um;$$(WindowsSdkDir)Include\10.0.15063.0\winrt;$(WindowsSdkDir)Include\10.0.15063.0\ucrt;$(WindowsSdkDir)Include\10.0.15063.0\shared;$(MyARXDir)inc;$(MyARXDir)inc-x64;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;</IncludePath>
<ReferencePath Condition="'$(ReferencePath)' == ''">$(VCInstallDir)atlmfc\lib\amd64;$(VCInstallDir)lib\amd64</ReferencePath>
<LibraryPath Condition="'$(LibraryPath)' == ''">$(WindowsSdkDir)Lib\10.0.15063.0\um\x64;$(WindowsSdkDir)Lib\10.0.15063.0\ucrt\x64;$(MyARXDir)lib-x64;$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
<SourcePath Condition="'$(SourcePath)' == ''">$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
<ExcludePath Condition="'$(ExcludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib\amd64;$(VCInstallDir)lib\amd64;</ExcludePath>
<NativeExecutablePath Condition="'$(NativeExecutablePath)' == ''">$(VCInstallDir)bin\AMD64;$(VCInstallDir)VCPackages;$(WindowsSdkDir)bin\x64;$(WindowsSdkDir)bin\win64\x64;$(WindowsSdkDir)bin;$(FrameworkDir)\$(FrameworkVersion);$(FrameworkDir)\$(Framework35Version);$(PATH);</NativeExecutablePath>
</PropertyGroup> <Import Project="$(VCTargetsPath)\Platforms\x64\PlatformToolsets\v140\ImportAfter\*.props" Condition="Exists('$(VCTargetsPath)\Platforms\x64\PlatformToolsets\v140\ImportAfter')" />
</Project>

  

再谈VS2010编译更高平台vs2012(v110),vs2015(v140)的objectARX程序的更多相关文章

  1. 如何走上更高平台分享传递干货知识:(开通个人Github面向开源及私有软件项目的托管平台:https://github.com/zlslch/)(图文详解)(博主推荐)

    不多说,直接上干货! https://github.com/ 欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑       同时,大家可以关注我的个人博客:    http ...

  2. 再谈mysql锁机制及原理—锁的诠释

    加锁是实现数据库并发控制的一个非常重要的技术.当事务在对某个数据对象进行操作前,先向系统发出请求,对其加锁.加锁后事务就对该数据对象有了一定的控制,在该事务释放锁之前,其他的事务不能对此数据对象进行更 ...

  3. C# 编译机器码过程原理之再谈反射

    一.引言 我们知道在Java中有虚拟机,代码运行时虚拟机把Java语言编译成与机器无关的字节码,然后再把字节码编译成机器指令执行,那么在.NET中程序是如何运行的呢? 其实运行原理是一样的,.NET中 ...

  4. VC6的工程转到VC2010或更高版本出现fatal error C1189编译错误的解决方法

    以前也遇到过,当时解决了没写下来,这次正好又遇到了,就顺手写一下吧,别下次又忘记了. 当VC6的工程转到VC2010或更高版本时编译出现如下错误: c:\program files\microsoft ...

  5. 再编写代码中报错:CS8107 C# 7.0 中不支持功能“xxxxxx”。请使用 7.1 或更高的语言版本。

    解决方法:项目右键属性 ---> 生成 ---> 找到最下面的高级按钮,点击高级按钮 ---> 常规 ---> 语言版本 ---> 选择 C#最新次要版本,或者比当前版本 ...

  6. [原]详解如何将cocos2dx项目编译到Android平台上的(方式一:Cywin+NDK)

    链接地址:http://m.blog.csdn.net/blog/yhc13429826359/29357815 2014-6-8阅读578 评论0 前言:cocos2dx作为一个开源的移动2D游戏框 ...

  7. 使用VS2010编译Qt 5.6.1过程记录

    由于Qt官方发布的Qt 5.6.1二进制安装包没有对应VS2010版本的,而我的电脑上只安装了VS2010,因此只能自己编译. 本文记录本人的编译安装过程,以及其中遇到的一些问题. 本文使用VS201 ...

  8. 再谈 Go 语言在前端的应用前景

    12 月 23 日,七牛云 CEO & ECUG 社区发起人许式伟先生在 ECUG Con 2018 现场为大家带来了主题为<再谈 Go 语言在前端的应用前景>的内容分享. 本文是 ...

  9. [转载]再谈百度:KPI、无人机,以及一个必须给父母看的案例

    [转载]再谈百度:KPI.无人机,以及一个必须给父母看的案例 发表于 2016-03-15   |   0 Comments   |   阅读次数 33 原文: 再谈百度:KPI.无人机,以及一个必须 ...

随机推荐

  1. libevent网络编程汇总

    libevent源码剖析: ========================================================== 1.libevent源码剖析一(序) 2.libeve ...

  2. OK6410之tftp下载内核,nfs…

    原文地址:OK6410之tftp下载内核,nfs挂载文件系统全过程详解[转]作者:千山我独行 由于工作的平台也是嵌入式,差不多的平台,所以一直就没有把自己买过来的ok6410板子好好玩玩.以前一直都是 ...

  3. 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 5 Octave Tutorial—5.6 向量化 Vectorization

    5.6 向量化 Vectorization 参考视频: 5 - 6 - Vectorization (14 min).mkv 下面是向量化的小例子,如果将所有u(j) .所有v(j).所有w(j)都看 ...

  4. resin3.X那些事之resin.conf

    [经验总结]resin那些事之resin.conf ----by johnson 话说与resin打交道很久了,却从未系统了解过.resin一听火了,说:你老兄当真与我打交道很久了?工具.流程如此发达 ...

  5. 01.webservice介绍

    不实现异构,实现远程系统之间的调用.

  6. iframe 模拟ajax文件上传and formdata ajax 文件上传

    对于文件上传 有好多种方式,一直想总结 文件上传的方法 今天就来写下 iframe  的文件上传的代码 本人语言表达能里有限,不多说了 直接上代码. 首先看 总体页面. 总共就三个文件. 实际上也就是 ...

  7. Qt入门-第一个Qt程序

    在安装完之后,迫不及待创建第一个Qt  demo

  8. Inception安装

    前言: MySQL语句需要审核,这一点每个DBA及开发人员都懂,但介于语句及环境的复杂性,大部分人都是望而却步,对其都是采取妥协的态度,从而每个公司都有自己的方法. 大多数公司基本都是半自动化(脚本+ ...

  9. 二项分布 , 多项分布, 以及与之对应的beta分布和狄利克雷分布

    1. 二项分布与beta分布对应 2. 多项分布与狄利克雷分布对应 3. 二项分布是什么?n次bernuli试验服从 二项分布 二项分布是N次重复bernuli试验结果的分布. bernuli实验是什 ...

  10. 面向对象property属性、静态方法和类方法

    一.property属性 1.什么是property特性? property是一种特殊的属性,访问它时会执行一段功能(函数)然后返回值. from math import pi class Circl ...