Archived

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

DirectDraw and .NET

This topic is 5654 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

Having moved completely over to MSV .NET, I am trying to set it up for DirectX development. First, I installed the DirectX 8.1 SDK. Next I went into the Tool->Options menu and added the appropriate include and lib locations and cycled them to the tops of the lists. Finally I create a window(Win32) and got the message loop all setup. My trouble is coming with creating the LPDIRECTDRAW7 ocject. I have a call to DirectDrawCreateEx as follows: DirectDrawCreateEx(NULL, (void**)&lpdd, IID_IDirectDraw7, 0); . When I try to build my project I get the following linker errors: DX1 error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "public: int __thiscall CDisplay::Initialize(struct HWND__ *)" (?Initialize@CDisplay@@QAEHPAUHWND__@@@Z) DX1 error LNK2001: unresolved external symbol _IID_IDirectDraw7 I checked to make sure that I linked the ddraw.lib and dxguid.lib files in my project settings as well as double checking to make sure I had included ddraw.h in the correct spot. Everything seems like it should be ok and should be working. Anyone using .NET know what my problem might be? If you need more code just let me know. Thanks in advanced!

Share this post


Link to post
Share on other sites
Well, since no responses I''ll assume nobody knew how to remedy the situation. That being said I''ll post the answer in the event someone else comes across this problem.

For some reason even though I had set the lib paths in tools->options as well as adding both libraries to my project settings MSVS .NET required me to actually include the lib files themselves. Meaning, Add Existing Files->Select both ddraw.lib and dxguid.lib. This makes me wonder whats going on though because my project was able to see the ddraw.h file just fine without having to include it explicitly to my project.

Anyway, hope this will be useful for someone else ;P

Share this post


Link to post
Share on other sites
Possibly you have two different versions of the libs in your lib path, and only one includes the function you are looking for. I know this has bitten me in the past, because either VC6 or one of its service packs included DDraw headers and libs, so I was getting compile-time errors until I bumped up the DX sdk directory higher in the Options->Directories list.

Share this post


Link to post
Share on other sites