• Advertisement

Archived

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

linking error (IID_IDirectDraw2)

This topic is 6565 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Have you added Dxguid.lib to the list of libraries? I think it''s the lib which define all the IID_... stuff.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement