warning C4005

Started by
3 comments, last by Bojanovski 10 years, 7 months ago

Hi!

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 :'(

Advertisement

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:

MSDN:

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

http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx

Microsoft can complicate things sometimes.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

You should have a look at Living without D3DX.

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.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

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?


EDIT:

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:


#ifndef DIRECTX11HEADERS_H
#define DIRECTX11HEADERS_H

#pragma warning( disable : 4005 )

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

#pragma warning( default : 4005 )

#endif

This topic is closed to new replies.

Advertisement