Thread: Access violation in C++

  1. #1
    Join Date
    Jul 2011

    Access violation in C++

    I have been trying to resolve the access violation in the program for bounding volume hierarchy. Which takes an 3-D object "statue.ply" and creates a bounding volume hierarchy through which a ray tracer is used. I get an access violation error while running it. I have used SDL and lib3d packages.
    I'm using visual studio 2010 on windows 7

    >Error: Unhandled exception at 0x00fa2e80 in bvh.exe: 0xC0000005: Access violation reading location 0x00000004.

    Call Stack :> `bvh.exe!Triangle::Triangle(const Vertex * vertexA, const Vertex * vertexB, const Vertex * vertexC, unsigned int r, unsigned int g, unsigned int b, bool twosided, bool triNormalProvided, Float3 triNormal)` Line 393 + 0x150 bytes C++

    here is the link to my code [c++] BVH_SAH -
    can anyone help with it.

    Thank you

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    You haven't posted your code. Also, you claim this is C++, so why did you post in the C section?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Quote Originally Posted by Sjvlsdsd View Post
    here is the link to my code [c++] BVH_SAH -
    Quote Originally Posted by Sjvlsdsd View Post
    can anyone help with it.
    Apparently not?

    Hope is the first step on the road to disappointment.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Moved to C++ programming forum.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access violation in std::map
    By Dark_Phoenix in forum C++ Programming
    Replies: 7
    Last Post: 08-16-2009, 12:02 PM
  2. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  3. Why am I having an access violation?
    By ldb88 in forum C++ Programming
    Replies: 12
    Last Post: 06-12-2007, 12:27 PM
  4. DLL Access Violation?
    By durban in forum C++ Programming
    Replies: 12
    Last Post: 10-04-2005, 05:55 PM
  5. Access Violation!!
    By Yoshi in forum C++ Programming
    Replies: 4
    Last Post: 09-11-2002, 01:22 PM