MinGW error: 'min' is not a member of 'std'

前端 未结 1 1156
一生所求
一生所求 2021-01-04 07:02

I\'m trying to convert some VC++ 6 code to a console app using only the standard libraries but am getting the following error from MinGW (whatever version is supplied with t

相关标签:
1条回答
  • 2021-01-04 07:27

    You should uncomment and fix #include <algorithm>, (without the .h) which is where std::min is declared.

    This has absolutely nothing to do with MinGW or GCC or Windows, this is standard C++ stuff. If you hit any other errors like this, search for the missing identifier on http://en.cppreference.com/w/.

    Also: use <cmath> and <cstdio>, and avoid malloc and friends, use new/new[] and delete/delete[] instead.

    0 讨论(0)
提交回复
热议问题