title: Failed to load model with assimp, access violation
body: <p>I got a problem when I want to import a simple model using assimp, whenever I compile the code it throws:</p>
  
  <p><code>0xC0000005: Access violation reading location 0x00000000.</code></p>
  
  <p>I know this is something about a null pointer but I just can't find it, the code goes as follows:</p>
  
  <pre><code>Model::Model(GLchar* path)
  {
      loadModel(path);
  }
  
  void Model::loadModel(std::string path)
  {
      Assimp::Importer import;
      const aiScene* scene = import.ReadFile(
          path, 
          aiProcess_Triangulate | 
          aiProcess_FlipUVs);
  
      if (!scene || scene-&gt;mFlags == AI_SCENE_FLAGS_INCOMPLETE || !scene-&gt;mRootNode){
          std::cout &lt;&lt; "ERROR::ASSIMP::" &lt;&lt; import.GetErrorString() &lt;&lt; std::endl;
          return;
      }
      directory = path.substr(0, path.find_last_of('/'));
  
      aiNode* node = scene-&gt;mRootNode;
      for (GLuint i = 0; i &lt; node-&gt;mNumChildren; i++){
          aiMesh* mesh = scene-&gt;mMeshes[node-&gt;mMeshes[i]];
          meshes.push_back(processMesh(mesh, scene));
      }
  
      for (GLuint i = 0; i &lt; node-&gt;mNumChildren; i++){
          processNode(node-&gt;mChildren[i], scene);
      }
  }
  </code></pre>
  
  <p>I use this Model class as a global variable:</p>
  
  <pre><code>//include stuff
  
  //other global variable
  Model mymodel("D:/Project/xxx/xxx.obj");
  
  int main(){
  //...
  return 0;
  }
  </code></pre>
  
  <p>The thing is that the error happens just between the line <code>directory = path.substr(0, path.find_last_of('/'));</code> and the line <code>aiNode* node = scene-&gt;mRootNode;</code> so I don't know how to debug it, could anyone tell me how to fix this? I use Visual Studio 2013-64 and assimp-3.1.1.</p>
  
  <p>Thank you very much.</p>