0

I keep getting errors when i try and use the vector class I have an object
vector<CSquare*>m_OldSquare;
however when i try and add elements to the list

CSquare** tempArray = m_FocusBlock->GetSquares();

	for(int i=0; i<4; i++)
	{
		m_OldSquares.push_back(tempArray[i]);	
	}

I get this error

unresolved external symbol __imp___CrtDbgReportW referenced in function "public: __thiscall std::_Vector_const_iterator<class CSquare *,class std::allocator<class CSquare *> >::_Vector_const_iterator<class CSquare *,class std::allocator<class CSquare *> >(class CSquare * *,class std::_Container_base const *)" (??0?$_Vector_const_iterator@PAVCSquare@@V?$allocator@PAVCSquare
@@@std@@@std@@QAE@PAPAVCSquare@@PBV_Container_base@1@@Z)
1>C:\\SDLBlox\Debug\SDLBlox.exe : fatal error LNK1120: 1 unresolved externals

also when i want to delete all elements in the list on exit

for(int i=0;i<m_OldSquares.size(); i++)
     delete m_OldSquares[i];

I get similar errors.
I don't really know what i'm doing wrong any help would be greatly appreciated

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by mitrmkar
0

It is some sort of project configuration mismatch, you could post the complete command line of the compiler. Try looking in Project/Properties/Configuration Properties/C/C++/Command Line.

0

/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MD /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt

0

/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MD /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt

Since you are doing a debug build, the "/MD" -option does not match. Open:

Project/Properties/Configuration Properties/C/C++/Code Generation

and change the option "Runtime Library" to:

"Multi-threaded Debug DLL (/MDd)"

0

Thanks it builds now but i got this warning
warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
I'm using SDL thats why i changed the runtime library to MD.
Is there anything i can do to not get the conflict but still compile the program

0

You might compile the SDL from source hence having complete control over the run-time library usage. You should not use a mixed combination of the libraries (i.e. static/dynamic/debug/release ...).

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.