Advertisement

linker error

Started by March 30, 2000 10:20 PM
2 comments, last by SoGreen 24 years, 8 months ago
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.
There's always something smaller and something bigger. Don't sweat the small stuff and don't piss off the big stuff :)
Try declaring the function before u call it.

// declare it
extern int CreateDirectDrawInterface()

// call it
CreateDirectDrawInterface()

// define it
int CreateDirectDrawInteface()
{
//.. blah, blah.
}
Advertisement
Thanks but i just forgot to add the header to my project.

I''m going to have to get some sleep one of these days.
There's always something smaller and something bigger. Don't sweat the small stuff and don't piss off the big stuff :)
I hate linker errors, they''re less useful than compiler errors.

-CobraA1

This topic is closed to new replies.

Advertisement