visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
2014-07-12 10:49
507 查看
看vc++技术内幕时 如果你使用的是比此书的附带项目更新版的vs时千万不要使用这种方法,这些对编译都有影响。
请使用当前新版的vs并输入书中改动的代码就Ok,因为vs会生成合理的mfc代码,养成好的习惯,,
一开始编译,第一个错误提示
[plain]
view plaincopyprint?
Building an MFC project for a non-Unicode character set is deprecated
首先参考这篇博客Building an MFC project for a non-Unicode character set is deprecated
安装 Multibyte MFC Library for Visual Studio 2013
然后编译,遇到这个问题
[plain]
view plaincopyprint?
warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
参考这个提问
Error preprocessor directives when building
在vs2013中上面这个
[plain]
view plaincopyprint?
warning C4996:'MBCS_Support....
双击会指向这个代码段
[cpp]
view plaincopyprint?
#ifdef _MBCS
// Warn about MBCS support being deprecated: see http://go.microsoft.com/fwlink/p/?LinkId=279048 for more information.
#pragma warning(push)
#pragma warning(1 : 4996)
就是这个链接http://go.microsoft.com/fwlink/p/?LinkId=279048文中提到可以通过将 NO_WARN_MBCS_MFC_DEPRECATION 预处理器定义添加到您的项目生成定义消除此警告。在项目stdafx.h文件中的#pragma once下面添加
[plain]
view plaincopyprint?
#define NO_WARN_MBCS_MFC_DEPRECATION
然后开始解决下面的问题
[plain]
view plaincopyprint?
error C1189: #error : MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header.
将stdafx.h文件中的
[cpp]
view plaincopyprint?
#define WINVER 0x0400
改为
#define WINVER 0x0501
#define _WIN32_WINNT 0x0400
改为
[cpp]
view plaincopyprint?
#define _WIN32_WINNT 0x0501
OK,然后是在vs2013中最后一个问题了错误 2 error CVT1100: 资源重复。类型: MANIFEST打开 项目属性 -> 配置属性 ->链接器 -> 清单文件 -> 生成清单 -> 选择否
everything is OK!
本文转自:http://blog.csdn.net/loongsking/article/details/21387255
请使用当前新版的vs并输入书中改动的代码就Ok,因为vs会生成合理的mfc代码,养成好的习惯,,
一开始编译,第一个错误提示
[plain]
view plaincopyprint?
Building an MFC project for a non-Unicode character set is deprecated
Building an MFC project for a non-Unicode character set is deprecated
首先参考这篇博客Building an MFC project for a non-Unicode character set is deprecated
安装 Multibyte MFC Library for Visual Studio 2013
然后编译,遇到这个问题
[plain]
view plaincopyprint?
warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
参考这个提问
Error preprocessor directives when building
在vs2013中上面这个
[plain]
view plaincopyprint?
warning C4996:'MBCS_Support....
warning C4996:'MBCS_Support....
双击会指向这个代码段
[cpp]
view plaincopyprint?
#ifdef _MBCS
// Warn about MBCS support being deprecated: see http://go.microsoft.com/fwlink/p/?LinkId=279048 for more information.
#pragma warning(push)
#pragma warning(1 : 4996)
#ifdef _MBCS // Warn about MBCS support being deprecated: see http://go.microsoft.com/fwlink/p/?LinkId=279048 for more information. #pragma warning(push) #pragma warning(1 : 4996)
就是这个链接http://go.microsoft.com/fwlink/p/?LinkId=279048文中提到可以通过将 NO_WARN_MBCS_MFC_DEPRECATION 预处理器定义添加到您的项目生成定义消除此警告。在项目stdafx.h文件中的#pragma once下面添加
[plain]
view plaincopyprint?
#define NO_WARN_MBCS_MFC_DEPRECATION
#define NO_WARN_MBCS_MFC_DEPRECATION
然后开始解决下面的问题
[plain]
view plaincopyprint?
error C1189: #error : MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header.
error C1189: #error : MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header.
将stdafx.h文件中的
[cpp]
view plaincopyprint?
#define WINVER 0x0400
改为
#define WINVER 0x0501
#define _WIN32_WINNT 0x0400
#define WINVER 0x0400 改为 #define WINVER 0x0501 #define _WIN32_WINNT 0x0400
改为
[cpp]
view plaincopyprint?
#define _WIN32_WINNT 0x0501
#define _WIN32_WINNT 0x0501
OK,然后是在vs2013中最后一个问题了错误 2 error CVT1100: 资源重复。类型: MANIFEST打开 项目属性 -> 配置属性 ->链接器 -> 清单文件 -> 生成清单 -> 选择否
everything is OK!
本文转自:http://blog.csdn.net/loongsking/article/details/21387255
相关文章推荐
- visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
- visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- visual c++.net 2003下如何自定义资源?!
- 在Visual C++.NET 2003中编译Log4cpp
- 如何判断一段程序是由C 编译程序还是由C++编译程序编译的?
- 如何用gcc/g++编译并运行C/C++程序
- 如何配置才能使用cl命令编译C/C++程序?
- .NET编译技术内幕
- Visual C++.NET数据库访问技术
- 扫盲贴 Visual Studio 2005/2008中如何编译和运行C++程序
- 如何使用 Visual Studio .NET 创建安装程序包
- 如何在Visual Studio.NET 2003下编译ANTLR 2.77
- 如何调用 Oracle 存储过程在 Visual Basic.NET 使用 Microsoft Oracle 托管提供程序
- C++ 接口与实现分离技术---如何将文件间的编译关系降至最低