Here is my experimental code:
#include <vector>
using namespace std;
#include "../FoundationClasses/jfc_common.h"
//using std::vector;
//unsigned int size(); Returns the number of elements in a vector
//push_back(TYPE element); Adds an element to the end of a vector
//swap(int x, int y); Swap elements x and y
//bool empty(); Returns true if the vector is empty
//void clear(); Erase all elements of the vector
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
vector <int> example; //Vector to store integers
example.push_back(3); //Add 3 onto the vector
example.push_back(10); //Add 10 to the end
example.push_back(33); //Add 33 to the end
for(int x=0; x<example.size(); x++)
{
sprintf(JFC::CHAR1K,"%i ",example[x]);dbPrint(JFC::CHAR1K); //Should output: 3 10 33
}
if(!example.empty()) //Checks if empty
example.clear(); //Clears vector
vector <int> another_vector; //Creates another vector to store integers
another_vector.push_back(10); //Adds to end of vector
example.push_back(10); //Same
if(example==another_vector) //To show testing equality
{
example.push_back(20);
}
for(int y=0; y<example.size(); y++)
{
sprintf(JFC::CHAR1K,"%i ",example[y]);dbPrint(JFC::CHAR1K); //Should output: 3 10 33
}
while ( LoopGDK ( ) )
{
dbSync();
};
};
It works if I compile in release mode but not in debug mode.
Errors:
------ Build started: Project: JegasLLC, Configuration: Debug Win32 ------
Linking...
libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
Main_Test_StdLib.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: int & __thiscall std::vector<int,class std::allocator<int> >::operator[](unsigned int)" (??A?$vector@HV?$allocator@H@std@@@std@@QAEAAHI@Z)
libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
Debug\JegasLLC.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://d:\files\code\CPP\Projects\JegasLLC\JegasLLC\Debug\BuildLog.htm"
JegasLLC - 5 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
any suggestions?