Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall SKINNEDMESH::Load(char * const,struct IDirect3DDevice9 *)" (?Load@SKINNEDMESH@@QAEXQADPAUIDirect3DDevice9@@@Z) referenced in function "void __cdecl initD3D(struct HWND__ *)" (?initD3D@@YAXPAUHWND__@@@Z)
Why?
header of my class:
#ifndef SKINNED_MESH#define SKINNED_MESH#include <windows.h>#include <d3dx9.h>#include <string>#include <vector>struct BONE: public D3DXFRAME{ D3DXMATRIX CombinedTransformationMatrix;};struct BONEMESH: public D3DXMESHCONTAINER{ ID3DXMesh* OriginalMesh; std::vector<D3DMATERIAL9> materials; std::vector<IDirect3DTexture9*> textures; DWORD NumAttributeGroups; D3DXATTRIBUTERANGE* attributeTable; D3DXMATRIX** boneMatrixPtrs; D3DXMATRIX* boneOffsetMatrices; D3DXMATRIX* currentBoneMatrices;};class SKINNEDMESH{ public: SKINNEDMESH(); ~SKINNEDMESH(); void Load(char fileName[], IDirect3DDevice9 *Dev); void Render(BONE *bone); void SetPose(D3DXMATRIX world, ID3DXAnimationController* animControl, float time); void SetAnimation(char name[]); std::vector<std::string> GetAnimations(); BONE* FindBone(char name[]); private: void UpdateMatrices(BONE* bone, D3DXMATRIX *parentMatrix); void SetupBoneMatrixPointers(BONE *bone); IDirect3DDevice9 *m_pDevice; D3DXFRAME *m_pRootBone; ID3DXAnimationController *m_pAnimControl;};#endif
and main.cpp
#include <d3d9.h>#include <d3dx9.h>#include <windows.h>#include <mmsystem.h>// include the Direct3D Library files#pragma comment (lib,"winmm.lib")#pragma comment (lib,"d3dx9d.lib")#pragma comment (lib,"d3d9.lib")#pragma comment (lib,"dxguid.lib")#pragma comment (lib,"DxErr.lib")#include "skinnedMesh.h"//.......SKINNEDMESH* m_skinnedMesh;//....void initD3D(){//......m_skinnedMesh->Load("mesh/drone.x", d3ddev);//.....}