Giter Site home page Giter Site logo

Comments (5)

agrittmsft avatar agrittmsft commented on July 22, 2024

Hi, could you try looking at your C++ Language Standard option? The SDK is built using C++14 or higher. Several of the std::max implementations were added only in C++ 14 https://en.cppreference.com/w/cpp/algorithm/max

Right click Project -> Properties
-> Configuration Properties
-> C/C++
-> Language
-> C++ Language Standard
= ISO C++14 Standard (/std:c++14)

from gltf-sdk.

agrittmsft avatar agrittmsft commented on July 22, 2024

If that doesn't work you could try adding this at the top of Sample3DSceneRenderer.cpp

#include <limits>

from gltf-sdk.

chriche-ms avatar chriche-ms commented on July 22, 2024

This problem is caused by Windows.h defining min and max macros which then break any usage of std::min/max and std::numeric_limits::max. The easiest fix is to add #define NOMINMAX before any of the #includes in pch.h (this can also be done via the C/C++->Preprocessor->Preprocessor Definitions property on the project's properties page).

Once you make this change you'll need to replace a few usages of the min/max macros in DeviceResources.cpp with std::min/max. Don't forget to change the integer literals to floats (e.g. std::max(m_outputSize.Width, 1.0f)) or you'll get some strange compile errors!

from gltf-sdk.

viperscape avatar viperscape commented on July 22, 2024

@chriche-ms that worked, thank you! now compiling
@agrittmsft your suggestions unfortunately did not help, as well I think VS min lang version was at 14, but I tried 17 just in case. Thank you though!

from gltf-sdk.

gaetandezeiraud avatar gaetandezeiraud commented on July 22, 2024

I proposed a fix when #define NOMINMAX is not possible. #55

from gltf-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.