Skip to main content
GameDev.net gamedev.net
🔒 Locked

linking error (IID_IDirectDraw2)

Started by PmpCh Jan 27, 2000 at 11:18 AM 3 replies 2.9k views
Original Post
PmpCh
PmpCh
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
SiCrane
SiCrane
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.
Crousto
Crousto
Have you added Dxguid.lib to the list of libraries? I think it''s the lib which define all the IID_... stuff.
PmpCh
PmpCh
Yesterday I included about every file I thought could solve my problem. Since dxguid.lib is included everything works fine. You were right Crousto, thx.

PmpCh

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.