Jump to content
  • Advertisement
Sign in to follow this  

DX11 warning C4005

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



So I've been trying to do this for far too long, but simply every option leads me to a dead end. I want to use DirectX 11 in visual studio 2012 without getting that damn warning C4005. My project is dependant on d3dx11 library so it has to be dx11, not dx11.1, unless I find some solution to manage my textures and effects loading without d3dx11!


I know what happened to windows 8 sdk and how it now includes directx 11.1 (except d3dx library) and when  I include my june 2010 version it all gets mixed up so bunch of redefinitions pops up.


So what is the easiest way to prevent visual studio from looking for directx headers in windows 8 sdk?


Also, can somebody, that has better understanding in microsoft's way of doing things, explain to me why did they create directx sdk without built-in libraries and functions for an important task such as textures and effects loading?? :S :'(

Share this post

Link to post
Share on other sites

Visual C++ is telling you that you are using a older version of the headers.


A fix, that I use, which MSDN recommends, is that you disable the warning C4005:





You can disable warning C4005 if needed; however, this warning indicates you are using the older version of these headers.




Microsoft can complicate things sometimes.

Share this post

Link to post
Share on other sites

You can always use DirectTK and DirectTex http://directxtk.codeplex.com/ http://directxtex.codeplex.com/
These replace most of D3DX function that you need the math ones are replaced by DirectMath and the good thing about this is that it is SSE2 aware.

I skimmed through directxtk a little but I could not find functions for loading .fxo file. It only says it offers built-in shaders to create functionality equivalent of BasicEffect from XNA. Also, I am hearing that directx 11.1 handles effects differently. What are the future plans from microsoft, will directx 11.2 in win 8.1 have this things fixed?
This tutorial from Frank D. Luna shows how to use hlsl (compile, load, send parameters such as constant buffers, SRVs, etc.) without using deprecated Effects11 library.
He also said: "In Metro applications, you cannot link with D3DCompiler.lib. Metro only allows certain APIs to be used for security (this is also why D3DX library and Effects cannot be used).", what answers one of my previous questions.
So I decided to keep using effects11.lib. As for the warning, I created this header which I call when I need directx headers:


#pragma warning( disable : 4005 )

#include <d3d11.h>
#include <d3dx11.h>
#include <d3dx11effect.h>

#pragma warning( default : 4005 )

Edited by Bojanovski

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!