Jump to content
  • Advertisement
Sign in to follow this  

Problem referencing DirectX in managed C++ project

This topic is 2911 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'm trying to reference the Microsoft.DirectX and Direct3D assemblies in a managed C++ project in .NET framework 3.5. I've verified that those files are located in C:\windows\assembly\gac. The version it shows for both assemblies is 1.0.2902.0. I use DirectX from another C# project all the time, so I'm absolutely sure DirectX is installed properly.

When I add
#using <Microsoft.DirectX.dll>
to a header file in the managed C++ project, I get
fatal error C1107: could not find assembly 'Microsoft.DirectX.dll': please specify the assembly search path using /AI or by setting the LIBPATH environment variable
I can reference other assemblies, for instance
#using <System.Windows.Forms.dll>
works fine, so I think the path is fine. Apart from that, wouldn't it always look in the windows path?

I also tried editing the project properties, Common Properties -> Framework and Properties -> Add New Reference, but the only tab I see there is Projects, but no .NET tab.

What the heck is going on?

- Lutz

Share this post

Link to post
Share on other sites
I could be wrong but as far as i remember the libs are in C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0

this is what i use for my vb.net apps, hope this helps.
and im not sure , but for unmanaged dx you have to set the include and lib dir's for the dx sdk.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!