Skip to content

Missing compiler definition for MSVC #275

@OgreTransporter

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions