The code for my program is as follows:
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
/*
* Code entry point - runs the game
*/
int main() {
IrrlichtDevice *device =
createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16, false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"Hello World!");
std::cout << "TEST" << std::endl;
device->getVideoDriver();
std::cout << "ANOTHER TEST" << std::endl;
while (true) {
//infinite loop for testing purposes
}
Code: Select all
Exception: STATUS_ACCESS_VIOLATION at eip=004012A1
eax=0000000C ebx=0065CC2C ecx=0065CB60 edx=00000000 esi=200717D5 edi=200717CD
ebp=0065CC08 esp=0065CBC4 program=C:\Users\Alex\Documents\ProgrammingStuff\cpp\Game\dist\Debug\Cygwin-Windows\game.exe, pid 12764, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
0065CC08 004012A1 (00000001, 0065CC2C, 200280F0, 610079C2)
0065CD18 61007A27 (00000000, 0065CD74, 61006A20, 0000000E)
End of stack trace
Code: Select all
device->getVideoDriver();
I am writing my code in NetBeans and using the 32bit Cygwin compiler with the 32bit Irrlicht libraries, although I am doing this on a 64bit pc (but I don't believe this should be causing the problem??).
How can I go about resolving this issue?
Thank you in advance