Skip to content

Missing compiler definition for MSVC #275

Description

@OgreTransporter

# Compiler flags and definitions for Visual Studio come here

For MSVC, add_compile_definitions(NOMINMAX) should be inserted to avoid problems with std::min and std::max in ads, AdsTool and AdsLibTest.bin. Without this definition, MSVC requires a data type specification std::min<T> and std::max<T>.

See: https://stackoverflow.com/questions/7035023/stdmax-expected-an-identifier

Alternatively, you can also add this to the projects:

if(MSVC)
    target_compile_definitions(ads PRIVATE NOMINMAX)
endif()

and

if(MSVC)
    target_compile_definitions(AdsTool PRIVATE NOMINMAX)
endif()

and

if(MSVC)
    target_compile_definitions(AdsLibTest.bin PRIVATE NOMINMAX)
endif()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions