Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/164.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 谷歌测试无法使用英特尔19和Visual Studio c++;19_C++_Windows_Unit Testing - Fatal编程技术网

C++ 谷歌测试无法使用英特尔19和Visual Studio c++;19

C++ 谷歌测试无法使用英特尔19和Visual Studio c++;19,c++,windows,unit-testing,C++,Windows,Unit Testing,我正试图在我的项目中嵌入谷歌测试。我正在使用: 项目类型:Visual Studio 16 2019 工具集:英特尔C++编译器19 架构:64位 CMake版本:3.16.1 我是按照你的指示去做的 我正在使用Gtest存储库的主分支(版本1.10) Cmake运行正常,并生成Visual Studio解决方案。但在构建时,cmock和gtest项目无法构建,并出现以下错误: 1>gtest-all.cc 1>Error #2586: \'operator=\' : deco

我正试图在我的项目中嵌入谷歌测试。我正在使用:

  • 项目类型:Visual Studio 16 2019
  • 工具集:英特尔C++编译器19
  • 架构:64位
  • CMake版本:3.16.1
我是按照你的指示去做的

我正在使用Gtest存储库的主分支(版本1.10)

Cmake运行正常,并生成Visual Studio解决方案。但在构建时,cmock和gtest项目无法构建,并出现以下错误:

1>gtest-all.cc
1>Error #2586: \'operator=\' : decorated name length exceeded, name was truncated

1>gmock-all.cc
1>C:\Users\saa4\Downloads\googletest-master\googlemock\include\gmock/gmock-actions.h(816): message #411: class template "testing::internal::InvokeMethodAction<Class, MethodPtr>" defines no constructor to initialize the following:
1>            const member "testing::internal::InvokeMethodAction<Class, MethodPtr>::obj_ptr"
1>            const member "testing::internal::InvokeMethodAction<Class, MethodPtr>::method_ptr"
1>  struct InvokeMethodAction {
1>         ^
1>
1>C:\Users\saa4\Downloads\googletest-master\googlemock\include\gmock/gmock-actions.h(845): message #411: class template "testing::internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>" defines no constructor to initialize the following:
1>            const member "testing::internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>::obj_ptr"
1>            const member "testing::internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>::method_ptr"
1>  struct InvokeMethodWithoutArgsAction {
1>         ^
1>gtest-all.cc
1> 错误#2586:\'operator=\':超过修饰名称长度,名称被截断
1> gmock-all.cc
1> C:\Users\saa4\Downloads\googletest master\googlemock\include\gmock/gmock actions.h(816):消息#411:class template“testing::internal::InvokeMethodAction”未定义用于初始化以下内容的构造函数:
1> const成员“testing::internal::InvokeMethodAction::obj_ptr”
1> const成员“testing::internal::InvokeMethodAction::method\u ptr”
1> 结构调用方法{
1>         ^
1>
1> C:\Users\saa4\Downloads\googletest master\googlemock\include\gmock/gmock actions.h(845):消息#411:类模板“testing::internal::InvokeMethodWithoutArgsAction”未定义用于初始化以下内容的构造函数:
1> 常量成员“测试::内部::调用方法而不使用argsaction::对象”
1> const成员“testing::internal::InvokeMethodWithoutArgsAction::method\u ptr”
1> 结构InvokeMethodWithoutArgsAction{
1>         ^

< >当编译器将其设置为Visual C++时,它正常构建。我需要为英特尔(C++)提供额外的配置参数吗?< /p>对于“2586”错误,可能是有用的。这两个“411”的诊断消息可能被安全地忽略。在英特尔C++编译器中有一些禁用特定诊断的开关,但我目前没有访问权限。我的电脑上有英特尔,所以在这方面我帮了大忙。@AdrianMole谢谢你的评论。我已经访问了这个链接。不过它看起来很旧,并且谈到了一个可以“安全忽略”的警告这似乎是旧的英特尔编译器版本的情况,但是对于英特尔19来说,这不是一个警告,并且破坏了构建。因为它是为Visual C++编译器编译的,我想知道这是否是建立集合的问题。对于2586’的错误,可能是有用的。这两个“411”的诊断消息可能被安全地忽略。THECHE在英特尔C++编译器中禁用特定的诊断,但我目前无法访问英特尔上的PC,所以我不能在这方面提供更多帮助。@阿德里安摩尔感谢您的评论。我已经访问了链接。但是它看起来相当旧,并且谈到了一个可以被“安全忽略”的警告。对于旧的英特尔编译器版本来说,情况似乎是这样,但是对于英特尔19来说,这并不是一个警告,它会破坏构建。因为它是为VisualC++编译器编译的,我想知道这是否是建立设置的问题。