linking error (IID_IDirectDraw2)
Hi everybody.
If I include this file in a project, I get no compiler error, but the linking process fails:
error LNK2001: ...extern symbol _IID_IDirectDraw2 and
fatal error LNK1200...
why is this??
CODE:
//
#ifndef _MABDD_
#define _MABDD_
#include // version 5.0 (include "ddraw.lib")
/*************************************/
class mabScreen
{
public:
mabScreen();
~mabScreen();
int CreateWindowed(HWND hWnd, dword width, dword
height);
int CreateExclusive(HWND hWnd, dword width, dword
height,
dword bpp, bool vgaMode);
private:
LPDIRECTDRAW2 ptDD;
LPDIRECTDRAWSURFACE3 ptDDPS, ptDDBB;
dword bpp;
bool exclMode;
};
/***************************************************/
// CONSTRUCTOR
mabScreen::mabScreen()
: ptDD(NULL),
ptDDPS(NULL),
ptDDBB(NULL),
bpp(0),
exclMode(false)
{
}
// DESTRUCTOR
mabScreen::~mabScreen()
{
if(ptDD != NULL)
ptDD->RestoreDisplayMode();
ptDDPS->Release(); ptDDPS = NULL;
ptDDBB->Release(); ptDDBB = NULL;
ptDD->Release(); ptDD = NULL;
}
// Create Screen (Exclusive Mode)
int mabScreen::CreateExclusive(HWND hWnd, dword width, dword height, dword bpp, bool vgaMode = false)
{
LPDIRECTDRAW ptDDtemp;
//DDSURFACEDESC ddsd;
//DDSCAPS ddscaps;
dword flags;
flags = DDSCL_EXCLUSIVE / DDSCL_FULLSCREEN / DDSCL_ALLOWREBOOT;
if(vgaMode)
flags /= DDSCL_ALLOWMODEX;
if(DirectDrawCreate(NULL, &ptDDtemp, NULL) != DD_OK)
return errorProc(901, ERR, gblShowErrMsg);
//e901: DirectDrawCreate failed
if(ptDDtemp->QueryInterface(IID_IDirectDraw2, (LPVOID*)
&ptDD) != DD_OK)
return errorProc(902, ERR, gblShowErrMsg);
//e902: QueryInterface failed
return OK;
}
/******************************************************/
#endif
Did you add ddraw.lib to your list of libraries to link? Just including the header file won''t include the library at link time.
January 27, 2000 02:19 PM
I have included ddraw.lib. It might be the wrong version but I doubt it, because it came along with some other directX version 5.0 stuff.
PmpCh
PmpCh
Have you added Dxguid.lib to the list of libraries? I think it''s the lib which define all the IID_... stuff.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement