0

I am trying to run the triangle.cpp project (the first one) in the OpenGL SuperBible 5th. edition. I am using Visual C++ 2010 Express. I can compile and build the project but when I try to run it I get an unhandled exception at the line marked with 12 asterisks in the code below. I would be very grateful for help solving this!!

void SetupRC()
{
    // Blue background
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f );
    shaderManager.InitializeStockShaders();

    // Load up a triangle
    GLfloat vVerts[9] = { -0.5f, 0.0f, 0.0f, 0.5f,
                           0.0f, 0.0f, 0.0f, 0.5f, 0.0f }; //************ 

   triangleBatch.Begin(GL_TRIANGLES, 3);
   triangleBatch.CopyVertexData3f(vVerts);
   triangleBatch.End();
} 
jrd1
  • 10,358
  • 4
  • 34
  • 51
  • You stated that you get an `Unhandled Exception`. What did it say, exactly? – jrd1 May 21 '14 at 09:01
  • 1
    It says: Unhandled exception at 0x00000000 in Triangle.exe: 0xC0000005: Access violation reading location 0x00000000. The following is the output from the debugger. – karloppe May 21 '14 at 09:07
  • 1
    'Triangle.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', Cannot find or open the PDB file 'Triangle.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file 'Triangle.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file 'Triangle.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file 'Triangle.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file 'Triangle.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file – karloppe May 21 '14 at 09:10
  • You know if it points to that line it might well be that `InitializeStockShaders` failed. – Bartek Banachewicz May 21 '14 at 09:12
  • If InitializeStockShaders failed do you know how I could fix that? – karloppe May 21 '14 at 09:17

0 Answers0