简体   繁体   English

vcxproj 从 vs2013 更新到 vs2015 后的 ICE(内部编译器错误)

[英]ICE (Internal compiler error) after vcxproj update from vs2013 to vs2015

"similar questions" do not cover my case. “类似问题”不包括我的情况。

After switching from VS2013 (v120) to VS2015(v140) result is:从 VS2013 (v120) 切换到 VS2015(v140) 结果是:

1>------ Build started: Project: my_project, Configuration: Debug Win32 ------
1>  aSource.cpp
1>d:\my_project\aHeader.h(61): warning C4114: same type qualifier used more than once
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(215): warning C4346: 'std::_Is_nothrow_swappable<_Ty>::value': dependent name is not a type
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(215): note: prefix with 'typename' to indicate a type
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(221): note: see reference to class template instantiation 'std::array<_Ty,_Size>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(215): error C2061: syntax error: identifier 'value'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(216): error C2091: function returns function
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(435): error C2988: unrecognizable template declaration/definition
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(435): error C2059: syntax error: ')'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(442): error C2065: '_Ty': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(442): error C2065: '_Size': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(442): error C2923: 'std::array': '_Ty' is not a valid template type argument for parameter '_Ty'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(442): error C2975: '_Size': invalid template argument for 'std::array', expected compile-time constant expression
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(20): note: see declaration of '_Size'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(443): error C2065: '_Ty': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(443): error C2065: '_Size': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(443): error C2923: 'std::array': '_Ty' is not a valid template type argument for parameter '_Ty'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(443): error C2975: '_Size': invalid template argument for 'std::array', expected compile-time constant expression
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(20): note: see declaration of '_Size'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(444): error C2143: syntax error: missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\array(444): error C2447: '{': missing function header (old-style formal list?)
1>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1>      Please choose the Technical Support command on the Visual C++
1>      Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Notes:笔记:

  • no Optimization (/Od)无优化 (/Od)
  • same issue also for VS2017(v141) and VS2019(v142)同样的问题也适用于 VS2017(v141) 和 VS2019(v142)
  • I have something in mind, that this project was also problematic to compile without VS2013-update5, but thats a real dangerous memory.我有一些想法,这个项目在没有 VS2013-update5 的情况下编译也有问题,但那是一个真正危险的 memory。 But maybe it rings someone elses bell?但也许它会敲响别人的钟声?
  • Upgrade is necessary because we want to use MongoDB, which latest cxx-driver does not support VS2013升级是必要的,因为我们要使用 MongoDB,最新的 cxx-driver 不支持 VS2013

EDIT: Content of aHeader.h编辑: aHeader.h的内容

#ifndef AINTERFACE_H
#define AINTERFACE_H 1

typedef int result;

#define IRESULT         result
#define IFUNCTION       virtual IRESULT
#define IIN(X)          X const&
#define IOUT(X)         X&
#define FUNCSPEC_IFACE  noexcept = 0
#define FUNCSPEC_IMPL   noexcept
#define ISUCCESS        0

class aInterface {
public:

    aInterface(IIN(char const* const) name)
        : iface_name_(name) {}

    IFUNCTION iface_name(IOUT(char const*) target)  FUNCSPEC_IFACE;

protected:

    char const*const    iface_name_;
};

#define IFACE_FUNCTIONS_DEFAULT                                         \
            IFUNCTION iface_name(IOUT(char const*) target) FUNCSPEC_IMPL\
                { target = aInterface::iface_name_; return ISUCCESS; }

#define IFACE_DEFAULT(NAME)                                         \
                    IFACE_FUNCTIONS_DEFAULT                         \
                    public: NAME() : aInterface(str(NAME))


#endif

Afaik this is the basic interface to implement CRTP Afaik 这是实现 CRTP 的基本接口

sidenote:边注:

#define str_hlp(arg) #arg
#define strnz(arg) str_hlp(arg)
#define strz(arg) str_hlp(arg) "\0"
#define str(arg) strz(arg)

Thanks谢谢

During the time of the projects initial development.在项目初期开发期间。 VS2015 was still not finished and VS2013 does (still) not fully support c++11 standard. VS2015 还没有完成,VS2013 确实(仍然)不完全支持 c++11 标准。

For compatibility reasons, a hack was made at a kinda hidden corner.出于兼容性原因,在一个隐蔽的角落进行了破解。

#if defined( _MSC_VER )/* && (_MSC_VER < insert here version which will support)*/

#  define noexcept  throw()
#  define constexpr const inline

#endif

We decided now to change that into我们现在决定将其更改为

#if defined( _MSC_VER ) && (_MSC_VER < 1910)

#  define noexcept  throw()
#  define constexpr const inline

#endif

and skip VS2015.并跳过VS2015。

Many thanks非常感谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从VS2013项目转换为VS2015项目之一 - Conversion from a VS2013 project to VS2015 one 使用继承构造函数时VS2015内部编译器错误 - VS2015 Internal Compiler Error when using inheriting constructors VS2015与VS2013的不同优化会导致浮点异常 - Different optimization in VS2015 vs VS2013 causes floating point exception VS2013:致命错误C1001:编译器发生内部错误 - VS2013: fatal error C1001: An internal error has occurred in the compiler VC ++ 14中数组值初始化的内部编译器错误(VS2015) - Internal Compiler Error on Array Value-Initialization in VC++14 (VS2015) ::std::regex_replace 与 Windows 上的语法标志 icase(VS2013 Update 4、VS2015 Update 3)使用字符范围不匹配 - ::std::regex_replace with syntax flag icase on Windows (VS2013 Update 4, VS2015 Update 3) does not match using character ranges 由于将代码从VS2013预览版导入到VS2012,unique_ptr编译器错误 - unique_ptr compiler error because of importing codes from VS2013 preview to VS2012 VS2015编译器错误C2679: - VS2015 compiler error C2679: 从 VS 2015 Update 3 更新到 VS2015 Update 3 d 后浮点计算行为不同的原因 - Reasons for different Floating Point Calculation Behaviour after update from VS 2015 Update 3 to VS2015 Update 3 d 我不明白VS2013编译器显示的错误 - I don't understand the error shown by the VS2013 compiler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM