opencv3.0&win7专业版Severice Pack1&visual studio 2013错误解决办法

错误原因:c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory  下的文件xmemory出错,因为该文件包好了xmemory0,错误原因就在这个xmemory0文件中。打开该文件如下所示



继续打开<xmemory0>文件,发现有这么一行,很明显该文件是VC下的文件但却包含了opencv3.0的头文件,这是错误的根本原因,将下图红框中的这句话注释掉。清理解决方案重新生成解决方案就OK了。


以下是可能的错误代码:

错误     1     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     370     1     test
错误     2     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     391     1     test
错误     3     error C2995: “_FwdIt std::_Uninit_copy(_InIt,_InIt,_FwdIt)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     395     1     test
错误     4     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     400     1     test
错误     5     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     436     1     test
错误     6     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     458     1     test
错误     7     error C2995: “_FwdIt std::_Uninit_move(_InIt,_InIt,_FwdIt)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     462     1     test
错误     8     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     468     1     test
错误     9     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     583     1     test
错误     10     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     609     1     test
错误     11     error C2995: “void std::_Uninit_fill_n(_FwdIt,_Diff,const _Tval *)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     614     1     test
错误     12     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     621     1     test
错误     13     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     644     1     test
错误     14     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     670     1     test
错误     15     error C2995: “void std::_Uninit_def_fill_n(_FwdIt,_Diff)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     674     1     test
错误     16     error C2061: 语法错误: 标识符“_Wrap_alloc”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory     680     1     test
错误     17     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     23     1     test
错误     18     error C2805: 二进制“operator >>”的参数太少     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     67     1     test
错误     19     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     74     1     test
错误     20     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     127     1     test
错误     21     error C2995: “std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     130     1     test
错误     22     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     137     1     test
错误     23     error C2805: 二进制“operator >>”的参数太少     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     140     1     test
错误     24     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     147     1     test
错误     25     error C2061: 语法错误: 标识符“basic_string”     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     158     1     test
错误     26     error C2995: “std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &)”: 函数模板已经定义     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     161     1     test
错误     27     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     168     1     test
错误     28     error C2143: 语法错误 : 缺少“,”(在“<”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     168     1     test
错误     29     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     226     1     test
错误     30     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     226     1     test
错误     31     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     229     1     test
错误     32     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     229     1     test
错误     33     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     232     1     test
错误     34     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     238     1     test
错误     35     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     239     1     test
错误     36     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     243     1     test
错误     37     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     243     1     test
错误     38     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     246     1     test
错误     39     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     246     1     test
错误     40     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     249     1     test
错误     41     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     255     1     test
错误     42     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     256     1     test
错误     43     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     260     1     test
错误     44     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     260     1     test
错误     45     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     263     1     test
错误     46     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     263     1     test
错误     47     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     266     1     test
错误     48     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     272     1     test
错误     49     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     273     1     test
错误     50     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     277     1     test
错误     51     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     277     1     test
错误     52     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     280     1     test
错误     53     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     280     1     test
错误     54     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     283     1     test
错误     55     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     289     1     test
错误     56     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     290     1     test
错误     57     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     294     1     test
错误     58     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     294     1     test
错误     59     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     297     1     test
错误     60     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     297     1     test
错误     61     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     300     1     test
错误     62     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     306     1     test
错误     63     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     307     1     test
错误     64     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     311     1     test
错误     65     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     311     1     test
错误     66     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     313     1     test
错误     67     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     313     1     test
错误     68     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     322     1     test
错误     69     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     323     1     test
错误     70     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     327     1     test
错误     71     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     327     1     test
错误     72     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     329     1     test
错误     73     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     329     1     test
错误     74     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     338     1     test
错误     75     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     339     1     test
错误     76     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     343     1     test
错误     77     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     343     1     test
错误     78     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     345     1     test
错误     79     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     345     1     test
错误     80     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     354     1     test
错误     81     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     355     1     test
错误     82     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     360     1     test
错误     83     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     360     1     test
错误     84     error C2084: 函数“int std::stoi(const int)”已有主体     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     362     1     test
错误     85     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     363     1     test
错误     86     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     363     1     test
错误     87     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     366     1     test
错误     88     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     372     1     test
错误     89     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     373     1     test
错误     90     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     377     1     test
错误     91     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     377     1     test
错误     92     error C2084: 函数“long std::stol(const int)”已有主体     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     379     1     test
错误     93     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     380     1     test
错误     94     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     380     1     test
错误     95     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     383     1     test
错误     96     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     389     1     test
错误     97     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     390     1     test
错误     98     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     394     1     test
错误     99     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     394     1     test
错误     100     error C2084: 函数“unsigned long std::stoul(const int)”已有主体     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     396     1     test
错误     101     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     397     1     test
错误     102     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     397     1     test
错误     103     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     400     1     test
错误     104     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     406     1     test
错误     105     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     407     1     test
错误     106     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     411     1     test
错误     107     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     411     1     test
错误     108     error C2084: 函数“_Longlong std::stoll(const int)”已有主体     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     413     1     test
错误     109     error C2065: “_Str”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     414     1     test
错误     110     error C2228: “.c_str”的左边必须有类/结构/联合     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     414     1     test
错误     111     error C2065: “_Base”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     417     1     test
错误     112     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     423     1     test
错误     113     error C2065: “_Idx”: 未声明的标识符     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     424     1     test
错误     114     error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     428     1     test
错误     115     error C2143: 语法错误 : 缺少“,”(在“&”的前面)     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     428     1     test
错误     116     error C1003: 错误计数超过 100;正在停止编译     c:\program files (x86)\microsoft visual studio 12.0\vc\include\string     428     1     test
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用\[2\]和引用\[3\]的内容,你可以在Windows操作系统下搭建Visual Studio 2013和OpenCV的运行环境。首先,你需要安装Visual Studio 2013。然后,你可以按照引用\[3\]的步骤安装OpenCV和OpenCV contrib库。如果你只需要安装OpenCV库而不需要OpenCV contrib库,可以按照引用\[3\]的第二步进行操作。如果你需要安装OpenCV contrib库,可以按照引用\[3\]的第三步进行操作。最后,你可以使用cmake进行编译和配置,具体步骤可以参考引用\[3\]的第四步至第七步。这样,你就可以在Visual Studio 2013使用OpenCV了。 #### 引用[.reference_title] - *1* *2* [windows下安装Visual Studio + CMake+OpenCV + OpenCV contrib+TensorRT](https://blog.csdn.net/qq_40716944/article/details/131297563)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Opencv+Visual studio +cmake配置+Opencv_contrib库安装(详细级)](https://blog.csdn.net/m0_56895840/article/details/127883936)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值