include vector 编译出错VC++
error C2665: “operator new” : 5个重载中没有一个可以转换参数1(从“const char [71]”类型)
这个错误是怎么回事啊,搜索了整个项目好像没有可疑的new操作阿。这个错误是在将两个工程合并成一个过程中产生的。合并前没有这样的错误。
MainFrm.cpp
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(34) : error C2665: “operator new” : 5 个重载中没有一个可以转换参数 1(从“const char [71]”类型)
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\new.h(100): 可能是“void *operator new(size_t,const std::nothrow_t &) throw()”
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\new.h(108): 或 “void *operator new(size_t,void *)”
试图匹配参数列表“(const char [71], int)”时
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(137) : 参见对正在编译的函数模板实例化“_Ty *std::_Allocate<std::allocator<_Ty>::value_type>(size_t,_Ty *)”的引用
with
[
_Ty=std::allocator<char>::value_type
]
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(136) : 编译类模板成员函数“std::allocator<_Ty>::pointer std::allocator<_Ty>::allocate(std::allocator<_Ty>::size_type)”时
with
[
_Ty=char
]
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(30) : 参见对正在编译的类模板实例化“std::allocator<_Ty>”的引用
with
[
_Ty=char
]
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(46) : 参见对正在编译的类模板实例化“std::_String_val<_Ty,_Alloc>”的引用
with
[
_Ty=char,
_Alloc=std::allocator<char>
]
d:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(1569) : 参见对正在编译的类模板实例化“std::basic_string<_Elem,_Traits,_Ax>”的引用
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
据说是因为STL与DEBUG NEW运算符的冲突(影响list、vector等)
解决方法1:注释掉以下代码:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
解决方法2:
将:代码中的#include <vector>移到stdafx.h的开头,也就是#program once的后面。
// http://blog.csdn.net/machh/article/details/43450725
include vector 编译出错VC++的更多相关文章
- boost库使用:vs2013下boost::container::vector编译出错解决
boost版本:boost_1_55_0 bug报告地址 https://svn.boost.org/trac/boost/ticket/9332 出错信息 has_member_function_c ...
- Android Studio2.1.2 Java8环境下引用Java Library编译出错
转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...
- 安卓编译出错: Process 'command 'C:\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1 解决!
安卓编译出错: Process 'command 'C:\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1 解决! ...
- protobuf编译出错的解决方案(iOS,OSX)
protobuf 最近使用protobuf,变编译工具时遇上一点问题.现在附上解决方案 编译过程 完全参照 https://github.com/alexeyxo/protobuf-objc 编译出错 ...
- #include <vector>用法之我见
vector是一种顺序容器,事实上和数组差不多,但它比数组更优越.一般来说数组不能动态拓展,(何为动态拓展,即是说如果你知道你要存的数据的个数,你定义的存储数据的数组大小也就决定了,但是若你事先不知道 ...
- Xamarin.iOS编译出错
Xamarin.iOS编译出错 错误信息:C:/Program Files(x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0 ...
- 深入理解include预编译原理
http://ticktick.blog.51cto.com/823160/596179 你了解 #include 某个 .h 文件后,编译器做了哪些操作么? 你清楚为什么在 .h文件中定义函数实现的 ...
- #include <vector>
双端队列deque比向量vector更有优势 vector是动态数组,在堆上 vector比array更常用 不需要变长,容量较小,用array 需要变长,容量较大,用vector 1 at() 取出 ...
- Cocos2d-x 3.0 编译出错 解决 error: expected ';' at end of member declaration
近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似"error: expected ';' at end of member dec ...
随机推荐
- 51Nod 1239 欧拉函数前n项和 杜教筛
http://www.51nod.com/Challenge/Problem.html#!#problemId=1239 AC代码 #include <bits/stdc++.h> #de ...
- Codeforces 932 A.Palindromic Supersequence (ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined))
占坑,明天写,想把D补出来一起写.2/20/2018 11:17:00 PM ----------------------------------------------------------我是分 ...
- sql server trace
http://www.cnblogs.com/zhijianliutang/p/4113911.html http://www.cnblogs.com/studyzy/archive/2009/01/ ...
- Java程序员从笨鸟到菜鸟之(五十二)细谈Hibernate(三)Hibernate常用API详解及源码分析--csdn 曹胜欢
新接触一个框架的目的就是想利用这个框架来为我们做一些工作,或者是让他来简化我们的工作,利用这个框架无非就是要利用这个框架所给我们提供的API去操作我们的数据,所以利用一个框架的好坏很大一部分取决于你对 ...
- windows平台是上的sublime编辑远程linux平台上的文件
sublime是个跨平台的强大的代码编辑工具,不多说. 想使用sublime完毕linux平台下django网站的代码编辑工作以提高效率(原来使用linux下的vim效率较低,适合编辑一些小脚本). ...
- [转]si设置
好吧,我有代码格式的强迫症,代码不整齐,我看的都头疼,之前一直喜欢用SourceStyler C++的,但是这个在win7下貌似不能使用,只能转向astyle了. http://www.cnblogs ...
- 我的Android进阶之旅------>Android关于Log的一个简单封装
android.util.Log类,能够方便地用于在编码调试过程中打印日志. 可是在公布后的产品中,假设有太多的日志打印.则会严重地影响性能. 对android.util.Log类做一个简单的封装.当 ...
- Laravel 数据库连接, 数据库名,配置文件修改
数据库连接:在根目录(laravel5.1下面有个.env文件,如果没有则会有个.env.example然后将此文件修改成.env文件即可)打开文件:找到:DB_HOST=127.0.0.1 //连 ...
- 最简单的基于FFmpeg的移动端样例附件:SDL Android HelloWorld
===================================================== 最简单的基于FFmpeg的移动端样例系列文章列表: 最简单的基于FFmpeg的移动端样例:A ...
- spring 接收_header 作为get请求的httpheader
今天项目遇到一个问题,我们项目用户验证和权限验证的信息(licence)是在http头中设置的,百度了一下,只有ajax才能设置头信息,form表单是无法设置的,但是我突然想起springMVC关于f ...