I made a game using Dev-C++, and currently transferred it over to Visual C++ 2008 Express.
The code worked fine before. How I transferred it was to simply move over all the files and include them to the VC++ project.
For some reason, I am getting a "Access violation writing location 0x00000000" error, even when that part of my program does not use pointers.
VC++ pointed the error in a low-level system function, so I moved up the stack frame and traced the cause to my program:
EventList.h
class EventList
{
public:
protected:
static void post(string sSource, string sMessage, string sEventLabel);
static list<string> s_events;
};
EventList.cpp (holds the offending function)
#include "EventList.h"
list<string> EventList::s_events;
void EventList::post(string sSource, string sMessage, string sEventLabel)
{
s_events.push_back(sSource + sEventLabel + sMessage);
}
The post function causes the error. If I comment out that line, the program continues to execute, but runs into another similar error in another function.
I am wondering, is the problem in the code or a setting in VC++?