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++的更多相关文章

  1. boost库使用:vs2013下boost::container::vector编译出错解决

    boost版本:boost_1_55_0 bug报告地址 https://svn.boost.org/trac/boost/ticket/9332 出错信息 has_member_function_c ...

  2. Android Studio2.1.2 Java8环境下引用Java Library编译出错

    转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...

  3. 安卓编译出错: 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 解决! ...

  4. protobuf编译出错的解决方案(iOS,OSX)

    protobuf 最近使用protobuf,变编译工具时遇上一点问题.现在附上解决方案 编译过程 完全参照 https://github.com/alexeyxo/protobuf-objc 编译出错 ...

  5. #include <vector>用法之我见

    vector是一种顺序容器,事实上和数组差不多,但它比数组更优越.一般来说数组不能动态拓展,(何为动态拓展,即是说如果你知道你要存的数据的个数,你定义的存储数据的数组大小也就决定了,但是若你事先不知道 ...

  6. Xamarin.iOS编译出错

    Xamarin.iOS编译出错 错误信息:C:/Program Files(x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0 ...

  7. 深入理解include预编译原理

    http://ticktick.blog.51cto.com/823160/596179 你了解 #include 某个 .h 文件后,编译器做了哪些操作么? 你清楚为什么在 .h文件中定义函数实现的 ...

  8. #include <vector>

    双端队列deque比向量vector更有优势 vector是动态数组,在堆上 vector比array更常用 不需要变长,容量较小,用array 需要变长,容量较大,用vector 1 at() 取出 ...

  9. Cocos2d-x 3.0 编译出错 解决 error: expected &#39;;&#39; at end of member declaration

    近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似"error: expected ';' at end of member dec ...

随机推荐

  1. Widows下利用OpenSSL生成证书

    1.下载OpenSSL的windows版本 32位:openssl-1.0.2a-i386-win32.zip 64位:openssl-1.0.2a-x64_86-win64.zip 下载之后解压即可 ...

  2. 洛谷—— P1407 工资

    https://www.luogu.org/problemnew/show/P1407 题目描述 有一家世界级大企业,他们经过调查,发现了一个奇特的现象,竟然在自己的公司里,有超过一半的雇员,他们的工 ...

  3. 洛谷——P3252 [JLOI2012]树

    P3252 [JLOI2012]树 题目描述 在这个问题中,给定一个值S和一棵树.在树的每个节点有一个正整数,问有多少条路径的节点总和达到S.路径中节点的深度必须是升序的.假设节点1是根节点,根的深度 ...

  4. BZOJ 1008: [HNOI2008]越狱 组合数学

    原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1008 题解: 就很傻逼的组合数学啊... $$ans=M^N-M*(M-1)^{(N-1) ...

  5. [__NSCFConstantString size]: unrecognized selector sent to instance 错误

    因为使用时候的类型和初始化的对象类型不匹配造成的,例如 - (NSMutableDictionary *)getMenuItems{    NSArray *defaultTmp = [NSArray ...

  6. GO --微服务框架(一) goa

    当项目逐渐变大之后,服务增多,开发人员增加,单纯的使用go来写服务会遇到风格不统一,开发效率上的问题. 之前研究go的微服务架构go-kit最让人头疼的就是定义服务之后,还要写很多重复的框架代码,一直 ...

  7. elasticsearch 最佳实践

    创建索引 无mapping 创建索引名称为index的索引 curl -XPUT http://localhost:9200/book 有mapping 如果需要定义每个类型的结构映射,创建type名 ...

  8. cocos2d-x-3.x bringToFront &amp; sendToBack实现

    void Node::bringToFront(void) { auto parent = this->getParent(); if (parent != nullptr && ...

  9. 百科知识 华为手机P7如何更换电池

    参考下面 教程 https://item.jd.com/3265516.html  

  10. Windows 无法卸载IE9怎么办

    1 如下图所示,使用自带的卸载工具无法卸载IE9 运行命令提示符,粘贴下面的命令 FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Window ...