I'm on windows 7 using Visual Studio 2012.
When I compile I get a lot of macro redefinition warnings caused by winerror.h versus dxgi.h, dxgitype.h, d3d11.h, d3d10.h; for example DXGI_STATUS_OCCLUDED, DXGI_STATUS_CLIPPED, DXGI_STATUS_NO_REDIRECTION etc.
I suppose this is because the windows sdk 8 is installed.How can I avoid this? Is there a way I can exclude these new libraries from my project?
キキジキキキジキ
1,01311 gold badge2222 silver badges3838 bronze badges
5 Answers
I ran into this problem using Visual Studio 2012 Express on Windows 8; however, my errors were almost exactly the same, and the fix is centered around the Windows SDK. This was in MSDN (see #5):
D3DX is not considered the canonical API for using Direct3D in Windows 8 and therefore isn't included with the corresponding Windows SDK. Investigate alternate solutions for working with the Direct3D API.
For legacy projects, such as the Windows 7 (and earlier) DirectX SDK samples, the following steps are necessary to build applications with D3DX using the DirectX SDK:
a. Modify the project’s VC++ directories as follows to use the right order for SDK headers and libraries.
b. Wherever 'd3dx9.h', 'd3dx10.h', or 'd3dx11.h' are included in your project, be sure to explicitly include 'd3d9.h', 'd3d10.h' and 'dxgi.h', or 'd3d11.h' and 'dxgi.h' first to ensure you are picking up the newer version. You can disable warning C4005 if needed; however, this warning indicates you are using the older version of these headers.
c. Remove all references to DXGIType.h in your project. This header doesn't exist in the Windows SDK, and the DirectX SDK version conflicts with the new winerror.h.
d. All D3DX DLLs are installed onto your development computer by the DirectX SDK installation. Ensure that the necessary D3DX dependencies are redistributed with any sample or with your application if it is moved to another machine.
e. Be aware that replacement technologies for current uses of D3DX11 include DirectXTex and DirectXTK. D3DXMath is replaced by DirectXMath.
I can't say for sure, but I think the Windows 8 SDK might be your problem. It may be a bit of a pain, but using the fix above will help make your code require less dependencies as well as making it compatible with both Windows 7 and Windows 8.
Axalo
2,58244 gold badges1818 silver badges3333 bronze badges
user2400203user2400203
I ran into this issue compiling SlimDX with Visual Studios 2012 on Windows 8. Windows SDK includes are inherited by default so they load after manually defined project include directories. To fix it add the Windows SDK as the first include directory. gradbotgradbot
$(WindowsSDK_IncludePath)
11.7k44 gold badges2929 silver badges6666 bronze badges
(Yay, my first answer on Stackoverflow)
Found a, hopefully good, workaround to the issue: Make your own header-file, that includes Windows.h (D3D11 includes that anyways), undefines windows macros and includes D3D11.h. Include this header instead of D3D11.h.Note: Obviously this prioritizes D3D11 versions of definition, over those of Windows.h
Please let me know what you think, and do not hold back on criticism. I am new to this and know that this is quite brute force and probably risky.
AggrobaticsAggrobatics
I changed the settings and included the directx from inside Windows Kits8.0 .
Actually I wanted instead to ignore it and use the windows headers and libraries I used before, but maybe it doesn't make a lot of difference.
The only thing is that now I have no longer access to the d3dx utilities.
キキジキキキジキ
1,01311 gold badge2222 silver badges3838 bronze badges
Another quick-fix - quick, as in 'probably not the best long-term solution' - is to change the 'platform toolset' under Solution/Properties/General - in my specific case I selected 'Visual Studio 2015 - Windows XP (v140_xp)' instead of 'Visual Studio 2015 (v140)'.
kalmiyakalmiya
Not the answer you're looking for? Browse other questions tagged c++visual-studio-2012directx-11winapi or ask your own question.
I'm Windows 7 using Visual Studio 2012 and Directx 10.
The problem is when I compiled, I get a lot of macro redefinition errors
This is my code:
When I compiled, I got a lot of macro redefinition errors:
1> Source.cpp 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(12): warning C4005: 'DXGI_STATUS_OCCLUDED' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49449) :'DXGI_STATUS_OCCLUDED' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(13): warning C4005: 'DXGI_STATUS_CLIPPED' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49458) : 'DXGI_STATUS_CLIPPED' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(14): warning C4005: 'DXGI_STATUS_NO_REDIRECTION' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49467) : 'DXGI_STATUS_NO_REDIRECTION' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(15): warning C4005: 'DXGI_STATUS_NO_DESKTOP_ACCESS' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49476) : 'DXGI_STATUS_NO_DESKTOP_ACCESS' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(16): warning C4005: 'DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49485) : 'DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(17): warning C4005: 'DXGI_STATUS_MODE_CHANGED' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49494) :'DXGI_STATUS_MODE_CHANGED' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(18): warning C4005: 'DXGI_STATUS_MODE_CHANGE_IN_PROGRESS' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49503) : 'DXGI_STATUS_MODE_CHANGE_IN_PROGRESS' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(21): warning C4005: 'DXGI_ERROR_INVALID_CALL' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49518) : 'DXGI_ERROR_INVALID_CALL' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(22): warning C4005: 'DXGI_ERROR_NOT_FOUND' : 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(26): warning C4005: 'DXGI_ERROR_DEVICE_HUNG' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49563) : 'DXGI_ERROR_DEVICE_HUNG' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(27): warning C4005: 'DXGI_ERROR_DEVICE_RESET' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49573) : 請'DXGI_ERROR_DEVICE_RESET' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(28): warning C4005: 'DXGI_ERROR_WAS_STILL_DRAWING' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49582) : 請'DXGI_ERROR_WAS_STILL_DRAWING' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(29): warning C4005: 'DXGI_ERROR_FRAME_STATISTICS_DISJOINT' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49592) : 請'DXGI_ERROR_FRAME_STATISTICS_DISJOINT' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(30): warning C4005: 'DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49601) : 'DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(33): warning C4005: 'DXGI_ERROR_NOT_CURRENTLY_AVAILABLE' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49629) :'DXGI_ERROR_NOT_CURRENTLY_AVAILABLE' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(34): warning C4005: 'DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49639) : 'DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED' 1>c:program filesmicrosoft directx sdk (june 2010)includedxgitype.h(35): warning C4005: 'DXGI_ERROR_REMOTE_OUTOFMEMORY' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49648) : 'DXGI_ERROR_REMOTE_OUTOFMEMORY' 1>c:program filesmicrosoft directx sdk (june 2010)included3d10.h(608): warning C4005: 'D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49793) : 'D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS' 1>c:program filesmicrosoft directx sdk (june 2010)included3d10.h(609): warning C4005: 'D3D10_ERROR_FILE_NOT_FOUND' : 1> c:program fileswindows kits8.0includesharedwinerror.h(49802) : 1>c:userspeterdocumentsvisual studio 2012projectswin32project2win32project2source.cpp(16): error C4430: 1>c:userspeterdocumentsvisual studio 2012projectswin32project2win32project2source.cpp(16): error C2146: 1>c:userspeterdocumentsvisual studio 2012projectswin32project2win32project2source.cpp(16): warning C4244: 1>c:userspeterdocumentsvisual studio 2012projectswin32project2win32project2source.cpp(190): error C2664: 'ID3D10Device::ClearRenderTargetView' :
Simon Adcock
3,27733 gold badges2020 silver badges4141 bronze badges
user2874454user2874454
1 Answer
Those aren't really errors, but warnings. Still, they make feel you bad =)
Microsoft deprecation style
DirectX SDK has been merged into Windows SDK (starting with Windows 8 SDK). Some of the functionality has been deprecated and removed.
You are mixing 2 SDKs:
It is not recommended to use DirectX SDK headers or libraries in new project. So, in project settings ->
'VC++ Directories' ->'Include Directories' remove references to DirectX SDK.
If you still need some old functionality (for example to compile old tutorial samples, or an old project), include DirectX SDK headers, but change in project settings ->
'General' ->'Platform Toolset' to 'Visual Studio 2012 - Windows XP (v110_xp)' .
Want to know more? Yes / No.
Community♦
Ivan Aksamentov - DropIvan Aksamentov - Drop
10.9k22 gold badges2626 silver badges5858 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged initializationdirectx or ask your own question.$begingroup$
I am developping an application using SharpDX and on one of my machines the call
fails with the error message
HRESULT: [0x887A0001], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_INVALID_CALL/InvalidCall], Message: Unknown
When I googled the error I found this where it states:
DXGI_ERROR_INVALID_CALL (0x887A0001)
The application provided invalid parameter data; this must be debugged and fixed before the application is released.
But how?
The error message does not give me any indication whatsoever to why the creation failed.
I checked the debug layer output but that only shows Info. No Warning, no Error, nothing. The factory and the device are created just fine and I tried several combinations of parameters in my SwapChainDescription but the error always remains the same.
How am I supposed to find out what triggers the error?
Just to be clear: I am not so much looking for a solution for my specific problem as I am wondering how I would go about debugging such a problem in general.
This is the boiled down code:
Dxgi Error Not Currently Available On Tv
I confirmed the sample description is valid using
(though, those are 1 and 0 anyway), that the format is supported using
Cossacks 3 build order. and also checked that
What else to check?
Update: I was able to fix the problem following the advice from here:
I changed this
to
In submitting a claim, you understand accept and agree that your identity and claim may be communicated to the alleged infringer.Counter Notification – Restoration of MaterialIf you have received a notice of material being takedown because of a copyright infringement claim, you may provide us with a counter notification in an effort to have the material in question restored to the site. Five feet apart watch online. Please send by email for prompt attention.Please note that we may share the identity and information in any copyright infringement claim we receive with the alleged infringer.
Roman Reiner
Roman ReinerRoman Reiner
$endgroup$
1 Answer$begingroup$
This typically happens when calling a D3D function with an invalid parameter (e.g. a NULL pointer where not permitted). This is exactly what the SwapChain's constructor documentation says:
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.
You need to check one by one the parameters you provide to this function, especially in this case you need to check that the present parameters you provide are correct (see the C++ doc for those, it's providing lots of details).
In your case, as it's failing on one specific machine, you're probably asking for stuff that isn't supported by its hardware, e.g. a D3D feature level too high for the graphics chip.
It sometimes help to check the samples provided by Microsoft to check what parameters they're passing, and see the differences that could cause the issue.
Laurent CouvidouLaurent Couvidou
8,32622 gold badges3434 silver badges5454 bronze badges
$endgroup$
Not the answer you're looking for? Browse other questions tagged c#directx11sharpdx or ask your own question.
After we setup feedback option on our blog, many readers started commenting on various issues and ask for our opinion and support. In most cases, it is just common issues and we make replies soon as possible. Last day, we got an interesting query from James Patrick regarding the graphics card. After looking into his case, we found that it would be appropriate to share among our fellow readers and help them to solve this issue in the future. So here are the full details shared by James regarding DXGI_ERROR_DEVICE_REMOVED while playing games on his PC.
Hi techiestechguide team,
I am attaching a copy of an issue which I usually see while playing games on my PC. The same has been posted in various forums and has been sent to webmasters of tech blogs. Hope any of them can crack this issue and send me a lead to solve this.
I have purchased PUBG game from steam and installed on my laptop. But every time after playing a few minutes, for eg: 5 minutes, they game gets crashed and show a DXGI_Error_Device_Removed error message. I don’t have the issue while playing offline games. My hardware specifications are mentioned below.
Intel Inspiron 15 3000 series
Core i7-5500 CPU @ 2.40Ghz
2 GB Nvidia Graphics Card
Dxgi_error_not_currently_available
8 GB RAM
512 SSD
x64 processor
I tried several tips posted on various forums, but none of them worked. Kindly check on this issue and post something useful to solve this issue.
DirectX function “FindClosestMatchingMode” failed
DirectX function “FindClosestMatchingMode” failed with DXGI_ERROR_DEVICE_REMOVED (“The video card has been physically removed from the system, or a drive upgrade for the video card has occurred.”) GPU: “”, Driver.”37849″. This error is usually caused by the graphics driver crashing; try installing the latest drivers. Also, make sure you have a supported graphics card with at least 1024 MB of VRAM.
Possible methods to solve DXGI_Error_Device_Removed error message#1:- Check your Graphics Card drivers are up to date
This is the first thing you should check while getting DXGI error device removed message. Many people don’t know how to update the graphics card drivers. Still, many using third-party tools to update the missing or outdated NVIDIA graphics card driver. But the right way to update the NVIDIA graphics card driver is by using the official software called NVIDIA GeForce experience. If you are already installed this software, open it and check whether new updates are available.
Error 327683 0 Sims 4
Step 1:- Download and install GeForce experience [For NVIDIA cards]. Use corresponding software for other brands.
Step 2:- Open the software and look whether new drivers are available or not. If yes, go and download the latest game drivers.
Step 3:- After installing the drivers, choose express install or custom install. If you choose express install, the system will install the driver automatically without further queries.
In 90% of cases, updating your Graphics card driver will fix all issues related to the GPU. Here also you can solve this issue by updating the driver using Getforce experience. There will be few users facing the same issue after the driver update. If you are one among them, keep looking the following tips.
#2:- Disable GPU overclocking
There are people who always love overclocking their graphics card. Overclocking is the process of boosting the speed of the graphics processor to increase the performance. While doing overclocking, the processor is forced to perform processing without providing enough cooling time. Thus the temperature rises accordingly and may damage your device.
So the next option to fix “DXGI error device removed” warning message is to disable GPU overclocking. If you have used any tools to overclock your GPU, reset it to the default values or disable the GPU overclocking. There are some cards which have overclocked at the time of manufacture. Please check whether your card comes under this category. If so, use tools like EVGA Precision or MSI Afterburner to bring the clock speed to normal value.
#3:- Switching off Anti-Aliasing and ShadowPlay
In your graphics card settings, you may have seen the term known as Anti-Aliasing and ShadowPlay. Anti-Aliasing is the process of smoothening of the images which usually requires while playing games and using High-end software tools.
ShadowPlay is hardware-accelerated screen recording utility introduced by Nvidia to allow users to record the gameplay and save it in a particular location. This is a part of GeForce Experience software and comes by default for Nvidia GTX 600 series card and above.
In both the cases, it requires a huge amount of Graphics processor space. Both Anti Aliasing and Shadowplay requires that much Graphics usage and sometimes result in DXGI error device removed message.
To disable Antialiasing open NVIDIA control panel. Under Manage 3D settings, You can see the option to turn off Antialiasing.
Choose the off option and save the values. Now try to ply the game again and check whether the issue persists. If still there is such issue, try disabling Shadowplay [if you have enabled it]
#4:- Alternative tips that you can try [Information gathered from various forums]
Before testing these tips, let me tell one thing. None of this informations are tested by me and not verified from our side. Instead, we gather these from various forums and you can check any of them works or you.
Conclusion
DXGI_ERROR_DEVICE_REMOVED is one of the popular error message shown while using graphics cards. There is no particular reason behind this issue. Most gamers see this kind of error while playing multiplayer games like Crysis 3, Battlefield 1, Battlefield 2, Battlefield 3, Farcry, PUBG and Fortnite. Anyway, the main reason is an outdated graphics driver. So the important thing you should check is whether you are running with the latest GPU drivers.
1 postsMember, Battlefield 3, Battlefield 4, BattlefieldMember
Exactly the same problem with BF4 after Windows 10 update & Nvidia driver..
https://forums.battlefield.com/en-us/discussion/131981/directx-error-so-i-cant-play-please-help /**/ Basically as of the most recent Windows 10 update, I haven't been able to play BF4. Every time I try to run the game it will start to load (small black window with the white wheel spinning in the top-right corner) and then it will stop and a message titled 'DirectX Error' pops up. It says 'DirectX function 'FindClosestMatchingMode' failed with DXGI_ERROR_NOT_CURRENTLY_AVAILABLE ('The requested functionality is not supported by the device or the driver.'). GPU: 'NVIDIA GeForce GTX570', Driver: 38871'. My driver is up to date so idk what the deal is.. /**/ Impossible to execute the game (full screen or in a window).. Please / s'il vous plait / aidez-nous !! Comments
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |