vs版本与_MSC_VER的对应
来源:互联网 发布:mac如何下载win10 编辑:程序博客网 时间:2024/05/16 18:49
同学问到一个问题,没有明白问题的原因。多方查找资料后,发现是程序使用的库与开发环境版本问题。
程序用vs2010编译时,出现错误。
错误1error C1189: #error : "Wrong Compiler. This library does only run with Visual C++ 7.1 and Visual C++ 6. Newer versions are currently not supported."打开此文件,部分代码如下:
#if !defined _MSC_VER#error "Wrong Compiler. This library does only run with Visual C++ 7.1 and Visual C++ 6. To suppress this Error, uncomment this line."#else#if _MSC_VER < 1200// older then VC6, too old to use library.#error "Wrong Compiler. This library does only run with Visual C++ 7.1 and Visual C++ 6. Older compiler versions are not supported."#elif _MSC_VER == 1200// VC6#elif _MSC_VER == 1300// VC70 not supported#error "Wrong Compiler. This library does only run with Visual C++ 7.1 and Visual C++ 6. VC7.0 is not supported."#elif _MSC_VER == 1310// VC71#elif _MSC_VER == 1400// VC80#elif _MSC_VER == 1500// VC90#else#error "Wrong Compiler. This library does only run with Visual C++ 7.1 and Visual C++ 6. Newer versions are currently not supported."// other maybe newer compiler ...#endif#endif
然后,查了下_MSC_VER,原来是用来定义编译器的版本。
MS VC++10.0 _MSC_VER=1600(VS2010)MS VC++9.0 _MSC_VER=1500(VS2008)MS VC++8.0 _MSC_VER=1400(VS2005)MS VC++7.0 _MSC_VER=1300MS VC++7.1 _MSC_VER=1310MS VC++6.0 _MSC_VER=1200在程序中加入_MSC_VER宏可以根据编译器版本让编译器选择行的编译一段程序。例如一个版本编译器产生的lib文件可能不能被另一个版本的编译器调用,那么在开发应用程序的时候,在该程序的lib调用库中放入多个版本编译器产生的lib文件。[1]
此实例就是这个问题,文件中的代码:
#if !defined UDSHL_LIB_NO_LINK#if (!defined _MSC_VER || _MSC_VER >= 1500)// vc80 compiler, and other here#pragma warning( disable : 4996) // Disable deprecated warnings.#if defined _DEBUG#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc9d.lib" )#else#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc9.lib" )#endif#elif (!defined _MSC_VER || _MSC_VER >= 1400)// vc80 compiler, and other here#pragma warning( disable : 4996) // Disable deprecated warnings.#if defined _DEBUG#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc8d.lib" )#else#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc8.lib" )#endif#elif (!defined _MSC_VER || _MSC_VER >= 1300)// vc71 compiler, and other here#if defined _DEBUG#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc71d.lib" )#else#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc71.lib" )#endif#else#if defined _DEBUG#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc6d.lib" )#else#pragma comment ( lib, UDSHL_LIB_DIR "IAT_UDSHL07_vc6.lib" )#endif#endif
根据不同的版本选择对应的库(IAT_UDSHL07_vc**.lib)文件。还分为debug和release版。
问题是,如果我只安装了vs2010该怎么运行呢?
更改工程的属性->平台工具集,选择v90后,提示
错误1error MSB8010: 指定的平台工具集(v90)需要 Visual Studio 2008。请确保在计算机上安装 Visual Studio 2008。
[1]. _MSC_VER.http://baike.so.com/doc/515910.html
- vs版本与_MSC_VER的对应
- _MSC_VER 与 Visual C++ 版本的对应关系
- VS版本记录、_MSC_VER记录
- _MSC_VER 编译器的版本
- VS版本 与 VC版本 的对应关系
- VS版本 与 VC版本 的对应关系
- VS与VC版本对应
- 如何确定VS编译器版本--_MSC_VER
- VS版本对应的 freamwork
- _MSC_VER 定义编译器的版本
- _MSC_VER 定义编译器的版本
- _MSC_VER 定义编译器的版本
- ObjectArx与vs版本对应关系
- VS.NET版本与VC版本对应关系
- 如何确定VS编译器版本--_MSC_VER || #if _MSC_VER > 1000 #pragma once #endif
- VC-VS对应版本
- VS-VC版本对应
- 一些编译器版本的_MSC_VER值
- cocos2d-x中init()与OnEnter()的关系
- 看完你就是电脑高手了。。赶紧转回去,要用随时能看哦!
- 降温啦,夭寿啦
- poj 3276 Face The Right Way
- hibernate select 查询方式总结
- vs版本与_MSC_VER的对应
- 数据结构算法(2) 图的深度优先搜索
- python hadoop 在streaming中获取文件名的方法 (参考java )适用: MRjob
- 时间格式化
- 项目管理师--质量管理 1
- asp_验证码
- Ogre中调用OgreMaxViewer来load场景文件.scene
- Ogre中导入Max烘焙的模型(4)——Ogre与MAX的坐标变化
- POJ 1988相对偏移