Error C2665: "Operator new": 5 overloads without one can convert parameter 1 (from "const char [71]" type)
What's wrong with this, searching the whole project as if there were no suspicious new operations. This error is generated by merging the two projects into one process. There are no such errors before merging.
MainFrm.cpp
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xmemory: Error C2665: "operator new": None of the 5 overloads can be converted to a parameter Number 1 (from "const char [71]" type)
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\new.h (100): May be "void *operator new (size_t,const std:: Nothrow_t &) throw () "
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\new.h (108): or "void *operator new (size_t,void *)"
When trying to match the parameter list "(const char [+], int)"
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xmemory (137): See Instantiating a function template being compiled _ty *std::_allocate< Std::allocator<_ty>::value_type> (Size_t,_ty *) "reference
With
[
_ty=std::allocator<char>::value_type
]
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xmemory (136): Compile class template member functions "STD::ALLOCATOR<_TY>:: Pointer std::allocator<_ty>::allocate (std::allocator<_ty>::size_type) "when
With
[
_ty=char
]
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xstring (30): See Instantiating a class template being compiled std::allocator<_ty> "References to
With
[
_ty=char
]
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xstring (46): See Instantiating a class template being compiled Std::_string_val<_ty,_ Alloc> "Reference
With
[
_ty=char,
_alloc=std::allocator<char>
]
D:\Program Files\Microsoft Visual Studio. NET 2003\vc7\include\xstring (1569): See Instantiating a class template being compiled Std::basic_string<_ Elem,_traits,_ax> "Reference
With
[
_elem=char,
_traits=std::char_traits<char>,
_ax=std::allocator<char>
]
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
It is said that the STL is in conflict with the debug new operator (affects list, vector, etc.)
Workaround 1: Comment out the following code:
#ifdef _DEBUG
#endif
solution 2:
# # # <vector> in code is moved to the beginning of stdafx.h, which is the back of #program once.
http://blog.csdn.net/machh/article/details/43450725
Include vector compilation error VC + +