Advertisement

linking error (IID_IDirectDraw2)

Started by January 27, 2000 11:18 AM
3 comments, last by PmpCh 25 years, 1 month ago
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.
Advertisement
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
Have you added Dxguid.lib to the list of libraries? I think it''s the lib which define all the IID_... stuff.
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

This topic is closed to new replies.

Advertisement