Heres the Code
Renderer.h
Code:
#include <vector>
#include "Vector3.h"
using namespace std;
struct BasicTri
{
Vector3 P1, P2, P3;
int Texture;
BasicTri(const BasicTri& t)
{
P1 = t.P1;
P2 = t.P2;
P3 = t.P3;
Texture = t.Texture;
}
BasicTri& operator=(const BasicTri& t)
{
if( &t != this ){
P1 = t.P1;
P2 = t.P2;
P3 = t.P3;
Texture = t.Texture;
}
return *this;
}
};
std::vector<BasicTri*> mBasicTri;
class GLRenderer
{
public:
void AddBasicTriToRenderer(BasicTri* t)
{
// then add to the vector
mBasicTri.push_back(t);
}
void RenderBasicTriangles(void);
};
And Renderer.cpp
Code:
#include "Renderer.h"
And this is the error:
Code:
--------------------Configuration: NeHeGL - Win32 Debug--------------------
Compiling...
Renderer.cpp
Example.cpp
Linking...
Renderer.obj : error LNK2005: "class std::vector<struct BasicTri *,class std::allocator<struct BasicTri *> > mBasicTri" (?mBasicTri@@3V?$vector@PAUBasicTri@@V?$allocator@PAUBasicTri@@@std@@@std@@A) already defined in Example.obj
Debug/NeHeGL.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
NeHeGL.exe - 2 error(s), 0 warning(s)
I've been working at this for hours, even rebuilt program from scratch, what is it?