std::min compiling error with Atmel Studio 7.0.1417 using Softpack 1.5

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

We have a compiling issue with Softpack 1.5 on ATSAME70Q21 platform since we upgraded to Atmel Studio 7.0.1417 (GCC 6.2.1), that compiler.h is defining min(a,b) and max(a,b) but then when we include some STL headers, we get compilation errors regarding std::min and std::max. I assume because min/max being redefined, it overrides the definitions in these headers if they are included after "compiler.h". This was not happening on Atmel 7.0.1188 with GCC 5.3.1. We could move the headers above compiler.h but then we run into other issues with 3rd party libraries that need included after this header. Is there a reason why files in libchip and libusb weren't using Min/Max definitions instead of min/max?

 

Thank you in advance,

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In my case compiler.h is a part of ASF, and it didn't change for me automatically when I upgraded AS 7 from 1188 to 1417.

 

I think the issue is arising with some changes in the C++ implementation. I was able to work around them by placing all the C++ standard headers first in my cpp files.

Last Edited: Wed. Jun 21, 2017 - 08:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please quote the error messages verbatim.
Are the errors coming at the suspected point of redefinition or are they given at the point(s) where you are using/calling min() and max()?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was getting errors like this:

		Invoking: ARM/GNU C Compiler : 6.2.1
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:61:0,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(243,56): error: macro "min" passed 3 arguments, but takes just 2
		     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
		                                                        ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(265,56): error: macro "max" passed 3 arguments, but takes just 2
		     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
		                                                        ^
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algo.h:60:0,
		                 from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:62,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\algorithmfwd.h(362,41): error: macro "max" passed 3 arguments, but takes just 2
		     max(const _Tp&, const _Tp&, _Compare);
		                                         ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\algorithmfwd.h(375,41): error: macro "min" passed 3 arguments, but takes just 2
		     min(const _Tp&, const _Tp&, _Compare);
		                                         ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\algorithmfwd.h(403,30): error: macro "min" requires 2 arguments, but only 1 given
		     min(initializer_list<_Tp>);
		                              ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\algorithmfwd.h(413,30): error: macro "max" requires 2 arguments, but only 1 given
		     max(initializer_list<_Tp>);
		                              ^
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h:35:0,
		                 from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algo.h:66,
		                 from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:62,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(320,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(324,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe" -mthumb -D__SAMV71Q21__ -DDEBUG -D__SAMV71Q21__ -DARM_MATH_CM7=true -DBOARD=SAMV71_XPLAINED_ULTRA -D__FREERTOS__  -I"../src/config" -I"../common/applications/user_application/samv71q21_samv71_xplained_ultra/config" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/common/utils" -I"../src" -I"../src/ASF/sam/utils/fpu" -I"../src/ASF/common/services/clock" -I"../src/ASF/sam/boards/samv71_xplained_ultra" -I"../src/ASF/sam/drivers/pmc" -I"../src/ASF/sam/utils/cmsis/samv71/source/templates" -I"../src/ASF/sam/utils" -I"../src/ASF/sam/utils/preprocessor" -I"../src/ASF/sam/boards" -I"../src/ASF/common/boards" -I"../src/ASF/common/services/gpio" -I"../src/ASF/sam/drivers/pio" -I"../src/ASF/sam/utils/header_files" -I"../src/ASF/common/services/ioport" -I"../src/ASF/sam/drivers/mpu" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/ASF/sam/utils/cmsis/samv71/include" -I"../src/ASF/sam/components/ethernet_phy/ksz8061rnb" -I"../src/ASF/sam/drivers/gmac" -I"../src/ASF/sam/drivers/matrix" -I"../src/ASF/sam/drivers/tc" -I"../src/ASF/sam/drivers/uart" -I"../src/ASF/common/services/serial/sam_uart" -I"../src/ASF/common/services/serial" -I"../src/ASF/common/utils/stdio/stdio_serial" -I"../src/ASF/sam/drivers/usart" -I"../src/thirdparty/FreeRTOS-9.0.0/include" -I"../src/thirdparty/FreeRTOS-9.0.0/portable/GCC/ARM_CM7/r0p1" -I"../src/thirdparty/FreeRTOS-Plus-Trace/Include" -I"../src/thirdparty/FreeRTOS-Plus-TCP/include" -I"../src/thirdparty/FreeRTOS-Plus-TCP/portable/Compiler/GCC" -I"../src/ASF/common/services/delay" -I"../src/tasks" -I"..\src\thirdparty\FreeRTOS-Plus-TCP\portable\NetworkInterface\ATSAMV71\components\ethernet_phy\ksz8061rnb" -I"../src/thirdparty/FreeRTOS-Plus-TCP/portable/NetworkInterface/ATSAMV71/drivers/gmac" -I"../src/ASF/sam/drivers/trng" -I"../.." -I"../../utils" -I"../src/hardware" -I"../../3rd-party/boost_1_60_0-minimal" -I"../src/ASF/sam/components/memory/sdram/is42s16100e" -I"../src/ASF/sam/drivers/sdramc" -I"../src/ASF/common/services/sleepmgr"  -O0 -Og -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions -mlong-calls -g3 -Wall -Wextra -pedantic -mcpu=cortex-m7 -c -mfloat-abi=hard -mfpu=fpv5-d16 -std=gnu++11 -fno-aggressive-loop-optimizations -pipe -fno-strict-aliasing -Wno-missing-field-initializers -MD -MP -MF "src/tasks/SpectraStreamTask.d" -MT"src/tasks/SpectraStreamTask.d" -MT"src/tasks/SpectraStreamTask.o"   -o "src/tasks/SpectraStreamTask.o" "../src/tasks/SpectraStreamTask.cpp" 
C:\Users\briggsjt\WorkingFiles\Excellims\Cypress\Cypress\Debug\Makefile(715,1): error: recipe for target 'src/tasks/SpectraStreamTask.o' failed
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(387,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return false; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(390,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return true; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(394,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(456,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(459,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(463,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(523,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(526,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(530,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(593,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(596,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(600,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(666,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(669,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(673,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(735,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() noexcept { return __glibcxx_min (char16_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(738,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() noexcept { return __glibcxx_max (char16_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(741,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(796,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() noexcept { return __glibcxx_min (char32_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(799,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() noexcept { return __glibcxx_max (char32_t); }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(802,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(858,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(861,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(865,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(925,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(928,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(932,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(998,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1001,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1005,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1065,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1068,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1072,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1137,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1140,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1144,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1204,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1207,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1211,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1277,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1280,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1284,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1347,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1350,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1354,38): error: macro "min" requires 2 arguments, but only 1 given
		       lowest() noexcept { return min(); }
		                                      ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1598,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1601,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1673,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1676,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1748,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\limits(1751,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
		           ^
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algo.h:66:0,
		                 from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:62,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(76,56): error: macro "max" requires 2 arguments, but only 1 given
		      _IntType __b = std::numeric_limits<_IntType>::max())
		                                                        ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(105,57): error: macro "max" requires 2 arguments, but only 1 given
		       _IntType __b = std::numeric_limits<_IntType>::max())
		                                                         ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(149,11): error: macro "min" requires 2 arguments, but only 1 given
		       min() const
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(156,11): error: macro "max" requires 2 arguments, but only 1 given
		       max() const
		           ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(227,40): error: macro "min" requires 2 arguments, but only 1 given
		  const __uctype __urngmin = __urng.min();
		                                        ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(228,40): error: macro "max" requires 2 arguments, but only 1 given
		  const __uctype __urngmax = __urng.max();
		                                        ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(296,40): error: macro "min" requires 2 arguments, but only 1 given
		  const __uctype __urngmin = __urng.min();
		                                        ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\uniform_int_dist.h(297,40): error: macro "max" requires 2 arguments, but only 1 given
		  const __uctype __urngmax = __urng.max();
		                                        ^
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:62:0,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algo.h(3447,34): error: macro "min" requires 2 arguments, but only 1 given
		     min(initializer_list<_Tp> __l)
		                                  ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algo.h(3459,34): error: macro "max" requires 2 arguments, but only 1 given
		     max(initializer_list<_Tp> __l)
		                                  ^
		In file included from ../src/ASF/common/boards/board.h:62:0,
		                 from ../src/config/FreeRTOSConfig.h:20,
		                 from ../src/thirdparty/FreeRTOS-9.0.0/include/FreeRTOS.h:98,
		                 from ../src/tasks/SpectraStreamTask.h:14,
		                 from ../src/tasks/SpectraStreamTask.cpp:13:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(195,5): error: expected unqualified-id before 'const'
		     min(const _Tp& __a, const _Tp& __b)
		     ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(195,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(195,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(195,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(195,5): error: expected initializer before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(219,5): error: expected unqualified-id before 'const'
		     max(const _Tp& __a, const _Tp& __b)
		     ^
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(219,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(219,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(219,5): error: expected ')' before 'const'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(219,5): error: expected initializer before 'const'
		In file included from c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\algorithm:61:0,
		                 from ../../alarm/Spectrum.h:15,
		                 from ../src/tasks/SpectraStreamTask.cpp:21:
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(243,5): error: 'std::min' declared as an 'inline' variable
		     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
		     ^~~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(246,7): error: expected primary-expression before 'if'
		       if (__comp(__b, __a))
		       ^~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(246,7): error: expected '}' before 'if'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(246,7): error: expected ';' before 'if'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(248,7): error: expected unqualified-id before 'return'
		       return __a;
		       ^~~~~~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(265,5): error: 'max' declared as an 'inline' variable
		     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
		     ^~~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(268,7): error: expected primary-expression before 'if'
		       if (__comp(__a, __b))
		       ^~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(268,7): error: expected '}' before 'if'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(268,7): error: expected ';' before 'if'
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(270,7): error: expected unqualified-id before 'return'
		       return __a;
		       ^~~~~~
c:\program files (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\c++\6.2.1\bits\stl_algobase.h(271,5): error: expected declaration before '}' token
		     }
		     ^
		make: *** [src/tasks/SpectraStreamTask.o] Error 1

I solved these by putting all C++ headers above all C headers, and in some cases adding #include <vector> to the top of cpp files.