Visual Studio Is Fine With std::max(), Unless It's In One Particular Static Library

  • Thread starter Thread starter a_unique_name
  • Start date Start date
A

a_unique_name

Guest
Hi Folks:

Developing on Windows 10 Pro, VS 2017 Community, WIN32, no MFC.

For some reason std::max() is causing errors on one of my C++ static libraries.

#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <algorithm>

void test()
{
int test = std::max(1, 2);
}


Here are the errors from the std::max statement:

error C2589: '(': illegal token on right side of '::'
error C2062: type 'unknown-type' unexpected
error C2059: syntax error: ')'


Std::max() is being used in many static libraries that are part of this solution. I can cut and paste that statement, or that test function, into any of them that include the requisite headers. Builds go fine.

What could it be about this one library, which has been working fine for weeks, to blow up as soon as it calls to std::max()?

Thanks
Larry

Continue reading...
 
Back
Top