Jump to content

  • Log In with Google      Sign In   
  • Create Account


linking error (IID_IDirectDraw2)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 PmpCh   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 January 2000 - 05:18 AM

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

Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9559

Like
Likes
Like

Posted 27 January 2000 - 07:15 AM

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.

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 27 January 2000 - 08:19 AM

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

#4 Crousto   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 January 2000 - 08:30 AM

Have you added Dxguid.lib to the list of libraries? I think it''s the lib which define all the IID_... stuff.

#5 PmpCh   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2000 - 04:21 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS