Jump to content
  • Advertisement
Sign in to follow this  

Strange error in my class

This topic is 2788 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My class does not use any external lib, only the patterns of DirectX, but is returning a strange error (as if there were any lib):

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)


header of my class:

#include <windows.h>
#include <d3dx9.h>
#include <string>
#include <vector>

struct BONE: public D3DXFRAME
D3DXMATRIX CombinedTransformationMatrix;

ID3DXMesh* OriginalMesh;
std::vector<D3DMATERIAL9> materials;
std::vector<IDirect3DTexture9*> textures;

DWORD NumAttributeGroups;
D3DXMATRIX** boneMatrixPtrs;
D3DXMATRIX* boneOffsetMatrices;
D3DXMATRIX* currentBoneMatrices;

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[]);

void UpdateMatrices(BONE* bone, D3DXMATRIX *parentMatrix);
void SetupBoneMatrixPointers(BONE *bone);

IDirect3DDevice9 *m_pDevice;
D3DXFRAME *m_pRootBone;
ID3DXAnimationController *m_pAnimControl;


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);


Share this post

Link to post
Share on other sites
void SKINNEDMESH::Load(char * const,struct IDirect3DDevice9 *)

does not match what is in the Header file:

void Load(char fileName[], IDirect3DDevice9 *Dev);

so it is looking for a function that does not exist.

Share this post

Link to post
Share on other sites
From the error its producing it looks like you are doing this:

In your header you declare Load to be:
void Load(char fileName[], IDirect3DDevice9 *Dev);

but in the implementation you have it as:
void SKINNEDMESH::Load(char *, IDirect3DDevice9 *)

so you need to have
void Load(char fileName[], IDirect3DDevice9 *Dev);

changed to:
void Load(char* filename, IDirect3DDevice9 *Dev);

The error is saying that a symbol is missing, this usually means that you are trying to call a function that has not been declared.

In your case you are calling a member function that does not exist in the class SKINNEDMESH for the reasons above.

Hope this helps.

Share this post

Link to post
Share on other sites
Unresolved symbols most of the time means you simply haven't defined the function. Where is the Load-function defined?

edit: Never mind this; post above was edited after posting this.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!