Sign in to follow this  

How do use Direct3DCreate9?

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

I am trying to render a scene and have been following the tutorial that comes with the help files in the sdk. When I come to compile it, I recieve the following error: t.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function _wWinMain@16 C:\Documents and Settings\Michael\My Documents\Visual Studio 2005\Projects\t\Debug\t.exe : fatal error LNK1120: 1 unresolved externals I looked this it up, and it told me that it does not know this function. I am only using the #import d3d9.h command. WHat can you recommend? One other point sorry. WHile looking through the sample browser, I recieve the following error on some of the samples: The referance device was selected but your computer only has a reduced-functionality referance device installed. Install the directx sdk to get the full referance device I obviously have the sdk installed to get the sample browser. How can I correct this? Thanks, Mike

Share this post


Link to post
Share on other sites
You need to link to d3d9.lib. Go to "Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies" and add "d3d9.lib dxguid.lib" to that.

Also, I'm not too sure about #import. If you get further problems, change it to #include <d3d9.h>.


jfl.

Share this post


Link to post
Share on other sites
I think the reference device it refers to is the reference rasterizer that comes with Direct3D. This is a pure software device that supports all Direct3D features, but is sloooow. The SDK samples will switch to this if your card can not support everything required. AFAIK, there are different versions of the reference rasterizer, though. You need the full Debug SDK to get all functionality out of the reference rasterizer, others just have a dummy version that doesn't actually do anything (it basically fills out all the classes with empty functions).

Share this post


Link to post
Share on other sites
Thanks guys,

The additional dependencies worked a treat, although there was no linker option under Configuration Properties, but I think I know why. I am using Visual Express, and it has "some of the more advanced features removed". To get round this I just modified the corewin_express file directly.

Second thing, I reckon youre right about the referance device. I have a GeForce 3 (!, soon to be upgraded to 7900GT SLI), so the referance will be used. I did install the debug version though...

Anyhow, thanks for all the help, and I will post a reply about the referance device when I upgrade the card.

Thanks again,
Mike

Share this post


Link to post
Share on other sites
Also, if I remember, you actually have to enable the reference device in the Direct3D settings. By default, it uses the blank reference device, so yo uhave to go into the Direct3D settings (with the utilities or config panel that comes with DirectX), and enable it.

Share this post


Link to post
Share on other sites
Configuration Properties should be in the Express Edition. Try finding it again. Note that the way you did it will link the DirectX libraries to all projects you make.

Share this post


Link to post
Share on other sites

This topic is 4202 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this