再谈VS2010编译更高平台vs2012(v110),vs2015(v140)的objectARX程序
前段时间我贴了一篇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程序的更多相关文章
- 如何走上更高平台分享传递干货知识:(开通个人Github面向开源及私有软件项目的托管平台:https://github.com/zlslch/)(图文详解)(博主推荐)
不多说,直接上干货! https://github.com/ 欢迎大家,加入我的微信公众号:大数据躺过的坑 人工智能躺过的坑 同时,大家可以关注我的个人博客: http ...
- 再谈mysql锁机制及原理—锁的诠释
加锁是实现数据库并发控制的一个非常重要的技术.当事务在对某个数据对象进行操作前,先向系统发出请求,对其加锁.加锁后事务就对该数据对象有了一定的控制,在该事务释放锁之前,其他的事务不能对此数据对象进行更 ...
- C# 编译机器码过程原理之再谈反射
一.引言 我们知道在Java中有虚拟机,代码运行时虚拟机把Java语言编译成与机器无关的字节码,然后再把字节码编译成机器指令执行,那么在.NET中程序是如何运行的呢? 其实运行原理是一样的,.NET中 ...
- VC6的工程转到VC2010或更高版本出现fatal error C1189编译错误的解决方法
以前也遇到过,当时解决了没写下来,这次正好又遇到了,就顺手写一下吧,别下次又忘记了. 当VC6的工程转到VC2010或更高版本时编译出现如下错误: c:\program files\microsoft ...
- 再编写代码中报错:CS8107 C# 7.0 中不支持功能“xxxxxx”。请使用 7.1 或更高的语言版本。
解决方法:项目右键属性 ---> 生成 ---> 找到最下面的高级按钮,点击高级按钮 ---> 常规 ---> 语言版本 ---> 选择 C#最新次要版本,或者比当前版本 ...
- [原]详解如何将cocos2dx项目编译到Android平台上的(方式一:Cywin+NDK)
链接地址:http://m.blog.csdn.net/blog/yhc13429826359/29357815 2014-6-8阅读578 评论0 前言:cocos2dx作为一个开源的移动2D游戏框 ...
- 使用VS2010编译Qt 5.6.1过程记录
由于Qt官方发布的Qt 5.6.1二进制安装包没有对应VS2010版本的,而我的电脑上只安装了VS2010,因此只能自己编译. 本文记录本人的编译安装过程,以及其中遇到的一些问题. 本文使用VS201 ...
- 再谈 Go 语言在前端的应用前景
12 月 23 日,七牛云 CEO & ECUG 社区发起人许式伟先生在 ECUG Con 2018 现场为大家带来了主题为<再谈 Go 语言在前端的应用前景>的内容分享. 本文是 ...
- [转载]再谈百度:KPI、无人机,以及一个必须给父母看的案例
[转载]再谈百度:KPI.无人机,以及一个必须给父母看的案例 发表于 2016-03-15 | 0 Comments | 阅读次数 33 原文: 再谈百度:KPI.无人机,以及一个必须 ...
随机推荐
- selenium -文件上传的实现 -对于含有input element的上传
使用selenium做自动化时,我们经常会遇到的一个让人头疼的问题就是文件上传. 问题的难点在于selenium无法识别并操作Windows窗口,若我们可以绕过弹出框直接把文件信息上传给选择按钮,难点 ...
- Linux系统SCSI磁盘扫描机制解析及命令实例(转)
转载请在文首保留原文出处:EMC中文支持论坛 介绍 Linux系统扫描SCSI磁盘有几种方式?Linux新增LUN之后,能否不重启主机就认出设备?如果安装了PowerPath,动态添加/删除LUN的命 ...
- jenkins 学习记录2
主题 在之前的学习中(http://www.cnblogs.com/abcwt112/p/6274575.html)我已经学会怎么打包了..这篇文章记录分享我学习如何利用jenkins将打完的包发布到 ...
- 【Dubbo学习】
dubbo的介绍 dubbo是一个分布式的开源框架,其核心部分如下: 1.服务提供者:provider 2.服务消费者:consumer 3.注册中心:registry (仅仅只是负责通知) 服务者在 ...
- 【289】◀▶ Python I/O & 读写文本文件
参考:Python 文件 I/O 参考:Python OS 文件/目录方法 目录: 01 open 函数 用于打开一个文件,创建一个 file 对象,相关的方法才可以调用它进行读写. 02 F ...
- Project Browser & Inspector
[Project Browser] You can drag items from the project structure list to the Favourites and also save ...
- window7 和ubuntu 双系统时 ubuntu不能引导怎么办?
假如你的Ubuntu的 / 分区是sda9,又假如 /boot分区是 sda6,在终端下输入sudo -imount /dev/sda7 /mntmount /dev/sda6 /mnt/boot ( ...
- Nginx+Tomcat集群+session共享
Nginx+Tomcat集群+session共享 1)安装Nginx 2)配置多个Tomcat,在server.xml中修改端口(端口不出现冲突即可) 3)在nginx.conf文件中配置负载均衡池, ...
- Django JSON-RPC
Django JSON-RPC https://github.com/samuraisam/django-json-rpc =============== A basic JSON-RPC Imple ...
- 浅谈android代码保护技术_加固
可看原文: http://www.cnblogs.com/jiaoxiake/p/6536824.html 导语 我们知道Android中的反编译工作越来越让人操作熟练,我们辛苦的开发出一个apk,结 ...