Configuration correction details for the VS2015 compiler environment for traditional D3D11 programs

Source: Internet
Author: User

A. Configuration details
  • Use #include < unordered_map > Alternative
    • This is the C + + standard Recommendation, nothing to say
  • Use #include <directxmath.h> Alternative <xnamath.h>
    • Note: If you do not want to modify the original Xnamath code, you need to define the _xm_no_intrinsics_ macro flag before including DIRECTXMATH.H to be compatible with the original Xnamath code
    • However, the _XM_NO_INTRINSICS_ flag will indicate that Directxmath does not use an enhanced instruction set such as SSE/SSE2, so its mathematical implementation is extremely slow. If you want to be fast, you have to remove the flag and rewrite the original Xnamath code accordingly.
  • Remove d3dx11 , no longer use any Legacy DX SDK in the header file or Lib , adhere to the use win SDK 8.0
    • This is the key to ensure that vs2015 can successfully compile links and avoid the confusion of subsequent compile link configurations.
    • Remove the include, LIB path definitions associated with Legacy DX SDK in Project settings
    • Remove the Lib dependencies associated with the Legacy DX SDK in the link settings, including D3dx11.lib, Dxerr.lib, etc. these lib do not write in the project linker inputs, with #pragma comment written in the header file
  • for d3dx11 , using Directxtex libraries to replace them; Directxtex Lib requires vs2015 re-compiling
    • Note: The API of theDirectxtex Library is significantly different than the D3DX11 API, such as texture loading API. All d3dx11 related code may need to be rewritten, this block is the maximum amount of work
  • for Dxerr , you can find its source code . cpp/h , include it directly into the project, compile it together
    • Note: Dxerr.lib in the Legacy DX SDK can no longer be used because it uses outdated libraries, so it is not possible to link in vs2015
    • In the case of direct inclusion of compilation dxerr.h/cpp, you may encounter a redefinition of the intervention definition flag, you have to manually adjust the
    • Add # include <Mmreg.h> definitions before # include <dxerr.h>
  • for effect11 , and its Lib requires vs2015 re-compiling
    • In order to improve the efficiency of STL debugging, the _has_iterator_debugging, _SECURE_SCL flag is set to 0, and the iterative sub-debugging function is turned off. Note: You must also set the above flag when compiling external lib such as Directxtex, effect11, etc. , or you cannot link
  • for D3d_compiler , can be directly used Win SDK 8 Bring your own Lib
    • Note: The D3d_compiler.lib runtime calls D3dcompiler_xx.dll (XX is the version number) and needs to copy this DLL to the system directory or the current directory of the program so that the runtime can load
    • Note: This DLL is in the bin directory of the Win SDK 8, but there are x32, x64 two versions, do not copy the DLL when the wrong version, or run-time crash (0xc000007b Error)
B. References
    1. http://blogs.msdn.com/b/chuckw/
    2. Http://blogs.msdn.com/b/chuckw/archive/2012/04/24/where-s-dxerr-lib.aspx
    3. Http://blogs.msdn.com/b/chuckw/archive/2013/08/21/living-without-d3dx.aspx
    4. Http://blogs.msdn.com/b/chuckw/archive/2015/08/05/where-is-the-directx-sdk-2015-edition.aspx
    5. Https://github.com/Microsoft/DirectXTex/wiki/DirectXTex
    6. Https://github.com/Microsoft/DirectXTK/wiki
    7. Https://github.com/Microsoft/DirectXMesh/wiki
    8. Https://github.com/Microsoft/FX11/wiki
    9. https://msoos.wordpress.com/2010/09/11/0xc000007b-error-solution/

Configuration correction details for the VS2015 compiler environment for traditional D3D11 programs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.