C++ Data-Oriented Modules using namespaces and extern
Your header file is missing include guards. Either put #pragma once at the start, or use the more portable:

#ifndef MESH_H_
#define MESH_H_

// ... rest of header

#endif


MESH_H_ has to be unique for the file.




namespace OpenGL{



If you don't own OpenGL, I'd recommend not naming your namespace after it. If they release OpenGL in a namespace, your code wouldn't be compatible. Try to use a namespace for your project. Similarly, I'd recommend not naming your header OpenGL.h, unless you put the header in a directory.




extern vector&lt;Vertex&gt; allVertices;
extern vector&lt;unsigned int&gt; allIndices;
extern vector&lt;Material&gt; allMaterials;
extern vector&lt;Mesh&gt; allMeshes;

extern string MESH_DIR;
extern vector&lt;string&gt; meshNames; //find mesh index by name



I'm assuming that in OpenGL.h, you have using namespace std;. Don't do this. It is especially bad in a header.

Also, if you find yourself using extern globals, you are almost certainly doing it wrong. These should either not exist at all (as in the calling code takes care of it), or they should be wrapped in a class that the calling code passes around.

These globals and the following point out that you really need to define a class. Maybe something like this:

class MeshManager { // this name is suspicious; "Manager" in a name is usually bad.
    std::vector&lt;Vertex&gt; vertices;
    std::vector&lt;unsigned int&gt; indices;
    std::vector&lt;Material&gt; materials;
    std::vector&lt;Mesh&gt; meshes;

    std::string meshDirectory;
    std::vector&lt;std::string&gt; meshNames;

public:
    void setMeshDirectory(std::string directory);
    void loadAllMeshes();

    Mesh loadMesh(std::string filename);
    void addMesh(std::string filename);
};


Note that this design isn't the best. You still need a constructor, and possibly accessors on the member variables. Also, setMeshDirectory and loadAllMeshes might be better as a constructor to MeshManager, or a static factory function if you prefer that style.