Quick explanation of what is the problem & how to fix. Better explanation coming later.
Problem cause: min max functions are defined in two different places. Standard C library (algorithm.h) and in my library in fake_avr.h
The fake_avr.h definition for min/max is needed for compatibility with Arduino-based code. The problem is that the Arduino version (or actually AVR) is not compatible with C statndard library version
Problem solution: choose what min/max your project uses
1. to use standard C lib version of min/max
Project->Build options->Compiler settings->#defines
add this to end of definitions:
(this is a safety device I added exactly because I knew this problem might appear)
2. to use AVR min/max
Do not put DISABLEAVRMIN in your project options.
Do not use standard C library math algorithms