CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    26

    0xC0000005: Access violation reading location 0x00000010

    when i compile program i dont get any error but when program starts up it gives this error. 0xC0000005: Access violation reading location 0x00000010
    my code seems no problem. no it gives any debuging error. what is the problem.
    thanks in advance. have a nice evening

  2. #2
    Join Date
    Jan 2010
    Posts
    26

    Re: 0xC0000005: Access violation reading location 0x00000010

    only warning at debugin mode
    warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

    i ignore this library (msvcrtd.lib). this time there is no error or warning. but program at the start up gives again this error" 0xC0000005: Access violation reading location 0x00000010 ". i use 3 library in my code first one is opengl others are assimp and SDL.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: 0xC0000005: Access violation reading location 0x00000010

    You're probably trying to access a NULL pointer somewhere, most likely one which you think points to a structure or array, specifically a field 16 bytes after the pointer itself.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: 0xC0000005: Access violation reading location 0x00000010

    When it crashes use the debugger to find out the line causing the crash and the NULL pointer you're trying to use.

  5. #5
    Join Date
    Jan 2010
    Posts
    26

    Re: 0xC0000005: Access violation reading location 0x00000010

    thanks you for reply. i think that error arises from Assimp library,loading 3d models.

    Code:
    /////////////////////////////////////////////
    //// DefaultLogger.cpp                                         Assimp library ( third party library)
    ////////////////////////////////////////////
    void Logger::info(const std::string &message)	{
    	
    	// SECURITY FIX: otherwise it's easy to produce overruns ...
    	if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
    		ai_assert(false);
    		return;
    	}
    	return OnInfo(message.c_str());       // compiler shows this point
    }

    Code:
    /////////////////////////////////////////////
    // main.cpp                                           my code
    ///////////////////
    
    class Model{
    	Assimp::Importer* importer;
    	const aiScene* data;
    public:
    	Model(const char* str, unsigned int flag){
    		
    		importer = new Assimp::Importer;
    		data = importer->ReadFile(str,flag);
    		//if(data==NULL)
    		//	std::cout<<"ReadFile() error\n";*/
    	}
    	
    	
    	void draw(){
    		/*
    		glEnableClientState(GL_VERTEX_ARRAY);
    		glVertexPointer( 3,GL_FLOAT,0,data->mMeshes[0]->mVertices);
    		unsigned int* indices = new unsigned int[data->mMeshes[0]->mNumFaces * 3];
    		for(unsigned int i=0,j=0; i<data->mMeshes[0]->mNumFaces; ++i,j+=3)
    		{
    			indices[j]   = data->mMeshes[0]->mFaces[i].mIndices[0];
    			indices[j+1] = data->mMeshes[0]->mFaces[i].mIndices[1];
    			indices[j+2] = data->mMeshes[0]->mFaces[i].mIndices[2];
    		}
    		glDrawElements( GL_TRIANGLES,3*data->mMeshes[0]->mNumFaces,GL_UNSIGNED_INT,indices);
    */
    	}
    };
    
    Model m("Building33.3DS",aiProcess_Triangulate            |
            aiProcess_JoinIdenticalVertices  |
            aiProcess_SortByPType);
    
    
    int main(int argc, char* argv[]){
    char c;
    
    
    std::cin>>c;
    	return 0;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured