I have 3 headers
DirectX.h
,Draws.h
,Memory.h
d
Every function has a definition in its corresponding .cpp so that is ruled out except for DirectX.h ofc
I tried a set of solutions to fix it but without success, like not including
stdafx.h in all on the Headers.
A little snippet of the three
Memory.h
#pragma once
#include "stdafx.h"
Class Memory
{
foo..
};
extern Memory *gMemory;
Draws.h
#pragma once
#include "stdafx.h"
Class Drawing
{
foo..
};
extern Drawing *Draw;
DirectX.h
#pragma once
#include "stdafx.h"
struct Direct
{
foo
};
extern Direct *DirectX;
Error
1>dllmain.obj : error LNK2001: unresolved external symbol "class Memory * gMemory" (?gMemory@@3PAVMemory@@A)
1>dllmain.obj : error LNK2001: unresolved external symbol "class Drawing * Draw" (?Draw@@3PAVDrawing@@A)
1>dllmain.obj : error LNK2001: unresolved external symbol "struct Direct * DirectX" (?DirectX@@3PAUDirect@@A)
1>Draws.obj : error LNK2001: unresolved external symbol "struct Direct * DirectX" (?DirectX@@3PAUDirect@@A)
stdafx.h
#include <windows.h>
#include <iostream>
#include <d3d9.h>
#include <d3dx9.h>
#include "Memory.h"
#include "Draws.h"
#include "DirectX.h"
dllmain.cpp The only parts where I'm using the extern are
gMemory->FindPattern(..);
if (!DirectX->Line)
{
D3DXCreateLine(pDevice, &DirectX->Line);
}
Draw->Circle(foo);