Visual Studio Community 2015 MFC 空项目无法编译
Visual Studio Community 2015 MFC empty project doesn't compile
我刚刚安装了Visual Studio Community 2015(版本14.0.24720.00),并尝试创建一个基于MFC对话框的项目。在向导中,我只选择了"基于对话框",将所有其他设置保留为默认设置。
该项目根本没有编译,这并不是一个有希望的起点。。。
我是不是忽略了什么?MFC模板是否损坏?
下面是我得到的编译时错误(为了易读,我去掉了长路径)。
谢谢你抽出时间。
program files (x86)microsoft visual studio 14.01>------ Build started: Project: MFCApplication, Configuration: Debug Win32 ------
1> stdafx.cpp
1>c:[...omissis...]atlcore.h(639): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32': undeclared identifier
1>c:[...omissis...]uianimation.h(2621): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxanimationhelper.h(411): error C2065: 'UI_E_VALUE_NOT_SET': undeclared identifier
1>c:[...omissis...]afxanimationhelper.h(441): error C2065: 'UI_E_VALUE_NOT_SET': undeclared identifier
1>c:[...omissis...]afxwin.h(2103): error C3646: 'm_pConfigs': unknown override specifier
1>c:[...omissis...]afxwin.h(2103): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxwin.h(2024): error C2065: 'GC_PAN_WITH_GUTTER': undeclared identifier
1>c:[...omissis...]afxwin.h(2024): error C2065: 'GC_PAN_WITH_INERTIA': undeclared identifier
1>c:[...omissis...]afxwin.h(2088): error C2065: 'GC_ALLGESTURES': undeclared identifier
1>c:[...omissis...]afxwin.h(2030): error C2065: 'GID_ZOOM': undeclared identifier
1>c:[...omissis...]afxwin.h(2030): error C2065: 'GC_ZOOM': undeclared identifier
1>c:[...omissis...]afxwin.h(2036): error C2065: 'GID_ROTATE': undeclared identifier
1>c:[...omissis...]afxwin.h(2036): error C2065: 'GC_ROTATE': undeclared identifier
1>c:[...omissis...]afxwin.h(2042): error C2065: 'GID_TWOFINGERTAP': undeclared identifier
1>c:[...omissis...]afxwin.h(2042): error C2065: 'GC_TWOFINGERTAP': undeclared identifier
1>c:[...omissis...]afxwin.h(2056): error C2065: 'GID_PAN': undeclared identifier
1>c:[...omissis...]afxwin.h(2056): error C2065: 'GC_PAN': undeclared identifier
1>c:[...omissis...]afxwin.h(2062): error C2065: 'GID_PAN': undeclared identifier
1>c:[...omissis...]afxwin.h(2062): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_VERTICALLY': undeclared identifier
1>c:[...omissis...]afxwin.h(2068): error C2065: 'GID_PAN': undeclared identifier
1>c:[...omissis...]afxwin.h(2068): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY': undeclared identifier
1>c:[...omissis...]afxwin.h(2074): error C2065: 'GID_PAN': undeclared identifier
1>c:[...omissis...]afxw
in.h(2074): error C2065: 'GC_PAN_WITH_GUTTER': undeclared identifier
1>c:[...omissis...]afxwin.h(2080): error C2065: 'GID_PAN': undeclared identifier
1>c:[...omissis...]afxwin.h(2080): error C2065: 'GC_PAN_WITH_INERTIA': undeclared identifier
1>c:[...omissis...]afxwin.h(2964): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxwin.h(2964): error C3646: 'GetCurrentGestureInfo': unknown override specifier
1>c:[...omissis...]afxwin.h(2964): error C2059: syntax error: ')'
1>c:[...omissis...]afxwin.h(2965): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:[...omissis...]afxwin.h(3020): error C2061: syntax error: identifier 'PTOUCHINPUT'
1>c:[...omissis...]afxwin.h(3030): error C2061: syntax error: identifier 'PTOUCHINPUT'
1>c:[...omissis...]afxwin.h(3043): error C3646: 'm_pCurrentGestureInfo': unknown override specifier
1>c:[...omissis...]afxwin.h(3043): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxwin.h(4141): error C2061: syntax error: identifier 'TBPFLAG'
1>c:[...omissis...]afxwin.h(5447): error C2143: syntax error: missing ';' before '*'
1>c:[...omissis...]afxwin.h(5447): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxwin.h(5447): error C2238: unexpected token(s) preceding ';'
1>c:[...omissis...]afxglobals.h(315): error C2143: syntax error: missing ';' before '*'
1>c:[...omissis...]afxglobals.h(315): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxglobals.h(315): error C2238: unexpected token(s) preceding ';'
1>c:[...omissis...]afxadv.h(244): error C2143: syntax error: missing ';' before '*'
1>c:[...omissis...]afxadv.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:[...omissis...]afxadv.h(245): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:[...omissis...]afxadv.h(314): error C2061: syntax error: identifier 'KNOWNDESTCATEGORY'
1>c:[...omissis...]afxadv.h(390): error C2065: 'ICustomDestinationList': undeclared identifier
1>c:[...omissis...]afxadv.h(390): error C2923: 'ATL::CComPtr': 'ICustomDestinationList' is not a valid template type argument for parameter 'T'
1>c:[...omissis...]afxadv.h(273): error C2039: 'AbortList': is not a member of 'ATL::_NoAddRefReleaseOnCComPtr<T>'
1>c:[...omissis...]afxadv.h(428): error C2065: 'IApplicationDestinations': undeclared identifier
1>c:[...omissis...]afxadv.h(428): error C2923: 'ATL::CComPtr': 'IApplicationDestinations' is not a valid template type argument for parameter 'T'
1>c:[...omissis...]afxadv.h(430): warning C4624: 'CAppDestinations': destructor was implicitly defined as deleted
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
已解决。Visual studio 2015继承了Visual studio 2009设置。删除包含文件夹
C: \Program Files\Microsoft SDK \Windows\v6.0A\包括
一切开始正常工作
在将2010年提前到2015年时也遇到了类似的问题。已将问题追踪到targetver.h文件。它定义的是旧版本的windows。用当前默认值替换了以前的所有定义。
target.h
// delete everything here
#include <SDKDDKVer.h>
-- end of target.h
也许这可以帮助您解决问题。在Visual Studio 2015中,默认情况下不再安装C++工具。取而代之的是,C++编译器、库和项目模板被移到了一个可选功能中。启动安装程序后,您可以选择"典型"或"自定义"安装;如果选择"Typical",则不能使用Visual Studio在C++中进行开发,因为只会安装托管语言和web开发工具。Visual Studio 2015中的设置更改影响C++开发人员
相关文章:
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 使用外部SDK工具链文件在VisualStudio上生成项目编译错误
- 示例C++项目编译中的警告
- 使用 raylib 静态库进行项目编译
- 如何使用我构建的库,而不会从源代码出错,但不为我自己的项目编译?
- C++项目编译强制使用 /clr 选项,尽管在没有公共语言运行时支持的情况下执行它
- 我可以在将项目编译为静态库(未定义的引用)时在代码中使用 QImage 吗?
- 旧项目编译的未定义引用
- Codelite不使用全局编译设置或项目编译设置
- x264项目编译
- 使用 Boost 单元测试进行 G++ 项目编译
- 项目编译时无法使用 gvim
- 强制将特定文件编译为Objective-C/文件类型,但将整个项目编译为Objective C++
- Eclipse显示错误,但项目编译并执行
- 如何最好地将C++/Cython项目编译成可执行文件
- CMake项目编译精细的SHARED库,但不使用STATIC库
- 如何在实践中解决项目编译中链接库的顺序问题
- Cef项目编译链接error2001
- 我的项目编译在vs2008没有一个单一的问题,但不是在2010年
- visual studio 2010 - c++项目编译和链接