i'm following a book on how to program with driectx 11 but i still got 3 error even though i've programmed it to be exactly the same and checked for diffrences for almost a full day now. i've got 3 errors
error LNK1120: 1 unresolved externals C:\Users\Me\documents\visual studio 2013\Projects\TestX engine\Debug\TestX engine.exe 1 1 TestX engine
Error 2 error LNK2019: unresolved external symbol _D3DX11CreateEffectFromMemory@20 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) C:\Users\Me\documents\visual studio 2013\Projects\TestX engine\TestX engine\Box.obj TestX engine
Error 1 error LNK2005: _WinMain@16 already defined in Box.obj C:\Users\Me\documents\visual studio 2013\Projects\TestX engine\TestX engine\InitDirect3D.obj TestX engine
and my code for the app is:
class BoxApp : public Framework_App
{
public:
BoxApp(HINSTANCE hInstance);
~BoxApp();
bool Init();
void OnResize();
void UpdateScene( float dt);
void DrawScene();
void OnMouseDown(WPARAM btnState, int x, int y);
void OnMouseUp(WPARAM btnState, int x, int y);
void OnMouseMove(WPARAM btnState, int x, int y);
private:
void BuildGeometryBuffers();
void BuildFX();
void BuildVertexlayout();
ID3D11Buffer* mBoxVB;
ID3D11Buffer* mBoxIB;
ID3DX11Effect* mFX;
ID3DX11EffectTechnique* mTech;
ID3DX11EffectMatrixVariable* mfxWorldViewProj;
ID3D11InputLayout* inputLayout;
XMFLOAT4X4 mWorld;
XMFLOAT4X4 mView;
XMFLOAT4X4 mProj;
float mTheta, mPhi, mRadius;
POINT mLastMousePos;
};
the problem should be somewhere around these parts, but i can't find them:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE PrevhInstance, PSTR cmdLine, int showCmd){
BoxApp theApp(hInstance);
if (!theApp.Init())
{
return 0;
}
return theApp.App_Run();
}
and:
void BoxApp::BuildFX()
{
DWORD shaderFlags = 0;
ID3D10Blob * compiledShader;
ID3D10Blob * compiledShaderMsgs;
HRESULT hr = D3DX11CompileFromFile((LPSTR)"mColor.fx", 0, 0, 0, "fx_5_0", shaderFlags, 0, 0, &compiledShader, &compiledShaderMsgs, 0);
if (compiledShaderMsgs != 0)
{
MessageBoxA(0, (char*)compiledShaderMsgs->GetBufferPointer(), 0, 0);
ReleaseCOM(compiledShaderMsgs);
}
D3DX11CreateEffectFromMemory(compiledShader->GetBufferPointer(), compiledShader->GetBufferSize(), 0, MainD3DDevice, &mFX);
ReleaseCOM(compiledShader);
mTech = mFX->GetTechniqueByName("ColorTech");
mfxWorldViewProj = mFX->GetVariableByName("gWorldViewProj")->AsMatrix();
}
in the second bit in particulary this: D3DX11CreateEffectFromMemory(compiledShader->GetBufferPointer(), compiledShader->GetBufferSize(), 0, MainD3DDevice, &mFX);
thank you beforehand, i really appreciate it.