Archived

This topic is now archived and is closed to further replies.

SoGreen

linker error

Recommended Posts

I don''t know if this is the right forum for this buuuuut... I''m trying to make my own header, sort of a directdraw wrapper I guess and when I try to compile my program I get this error tryout.obj : error LNK2001: unresolved external symbol "int __cdecl CreateDirectDrawInterface(void)" (?CreateDirectDrawInterface@@YAHXZ) My program is just a minimum windows program with a call to this function int CreateDirectDrawInterface() { if(FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) DXError(1); if(FAILED(lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *)&lpdd4))) DXError(2); if(FAILED(lpdd->Release())) DXError(5); lpdd = NULL; if(FAILED(lpdd4->SetCooperativeLevel(hwnd, DDSCL_EXCLUSIVE / DDSCL_FULLSCREEN / DDSCL_ALLOWMODEX / DDSCL_ALLOWREBOOT) DXError(3); } which is located in my DXWrap.h header file. Can someone help me out here im stumped.

Share this post


Link to post
Share on other sites
Try declaring the function before u call it.

// declare it
extern int CreateDirectDrawInterface()

// call it
CreateDirectDrawInterface()

// define it
int CreateDirectDrawInteface()
{
//.. blah, blah.
}

Share this post


Link to post
Share on other sites