warning C4003: not enough actual parameters for macro 'max' - Visual Studio 2010 C++

前端 未结 4 1429
盖世英雄少女心
盖世英雄少女心 2020-12-15 15:27

I have the following warnings while compiling an openFrameworks 007 project on Visual Studio 2010 SP1:

d:\\pedro\\development\\videoflow\\openframeworks\\lib         


        
相关标签:
4条回答
  • 2020-12-15 15:50

    Add #undef max to the top of the relevant files.

    0 讨论(0)
  • 2020-12-15 15:57
    #pragma warning (disable: 4003)
    
    0 讨论(0)
  • 2020-12-15 16:03

    You are not the first to be bitten by these ancient macros. They can't remove them, that would break old code. So they came up with another macro to remove the sting. Make it look like this:

    #ifndef NOMINMAX
    # define NOMINMAX
    #endif
    #include <windows.h>
    // Rest of your #includes here
    //...
    
    0 讨论(0)
  • 2020-12-15 16:04
    #ifdef _WIN32
    #pragma warning(push)
    #pragma warning(disable : 4003) 
    #endif
    
    ... // code with min/max warning you wish to suppress
    
    #ifdef _WIN32
    #pragma warning(pop)
    #endif
    
    0 讨论(0)
提交回复
热议问题