I know there are many post on macro redefinition issues but I still cannot understand how the reorder fix the problem.
When my project has includes in this order in VC++ Directories->Include Directories
like shown in here
and in C/C++ -> General -> Additional Include Directories
like shown here
I get macro redefinition
warning:
1>c:***************************************\directx\dxgitype.h(12): warning C4005: 'DXGI_STATUS_OCCLUDED' : macro redefinition (############.cpp)
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\winerror.h(49449) : see previous definition of 'DXGI_STATUS_OCCLUDED'
But, when I remove $(SolutionDir)\common\ExternalLibs\directx
from Additional Include Directories
and move it to VC++ Directories->Include Directories
the warning disappears.
I checked both winerror.h
and dxgitype.h
and I didn't see #undef DXGI_STATUS_OCCLUDED
. So, how the reorder fixed the warning? At least one of the header should have #undef
in order to allow it to be defined in other header, right? Also, Additional Include Directories
are loaded after Include Directories
or what?