Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Trouble with DirectDraw

I'm having trouble compiling a program using DirectDraw. Actually, it compiles fine (my program) but I get a linker error. I've set both the DirectX sdk include and lib paths and I also manually included the "ddraw.lib" library. When I try to build the application I get a LNK2001 error: "unresolved external symbol _IID_IDirectDraw4". Does anyone know how to fix this?


-=Thanks=-


Comments

  • Do you really have DirectX SDK installed (witch version)? If you print the directive: #pragma comment (lib,"ddraw.lib") in your header file, VC++ will search up the correct lib.file.


    Or, maybe you have forgot to add a braces somewhere? A missing function body will cause LNK2001.


    I dontt know? Give me more info.


  • Obviously there is something wrong with your lib file. Make sure you have installed the SDK correctly, that the lib files are in your lib path and that you have a correct version.




  • Make sure the paths you put in for the SDK (libraries and include files) are moved up to the top of the list, as the DirectX 5 SDK comes with Visual C++ 6 and is automatically in your default Visual C++ path whether you want it or not.

    Another thing when you say you have included ddraw.lib do you mean you have #included it or added it to your project, which is what you are supposed to do. You do this by clicking Project and then settings, and then click the Link tab and add it to the text line of libraries. I also presume you have #include(d) and you have the line

    #define INITGUID

    at the top of your program.




  • Make sure the paths you put in for the SDK (libraries and include files) are moved up to the top of the list, as the DirectX 5 SDK comes with Visual C++ 6 and is automatically in your default Visual C++ path whether you want it or not.

    Another thing when you say you have included ddraw.lib do you mean you have #included it or added it to your project, which is what you are supposed to do. You do this by clicking Project and then settings, and then click the Link tab and add it to the text line of libraries. I also presume you have #include(d) ddraw.h and you have the line

    #define INITGUID

    at the top of your program.





Sign In or Register to comment.