Std::copy found for photon but not core

Created a cpp library and am using the std::copy method.
In the Web IDE this compiles just fine for a Photon, but when I switch to compile for Core it gives an error. The library includes application.h. Do I need another header on Core to get std::copy?

In file included from ../inc/spark_wiring.h:29:0,
                 from ../inc/application.h:29,
                 from StringBuilder.h:4,
                 from StringBuilder.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
 #warning  "Defaulting to Release Build"
  ^
StringBuilder.cpp: In member function 'void StringBuilder::append(char*)':
StringBuilder.cpp:28:13: error: 'copy' is not a member of 'std'
             std::copy(buf, buf + currentBufferSize, newBuf);
             ^

make: *** [StringBuilder.o] Error 1

std::copy is found in the <algorithm> header. http://www.cplusplus.com/reference/algorithm/copy/

Our “application.h” header is there to make avaialble our Wiring library. Anything else should be explicitly included, even if it’s incidentally included, because there’s no guarantee it will always be there. :wink:

Including for a Core build causes the following compiler error:

 In file included from ../inc/spark_wiring.h:29:0,
                 from ../inc/application.h:29,
                 from StringBuilder.h:5,
                 from StringBuilder.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
 #warning  "Defaulting to Release Build"
  ^
In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:61:0,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:56: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^

In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algo.h:60:0,
                 from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:62,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/algorithmfwd.h:360:41: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp&, const _Tp&, _Compare);
                                         ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/algorithmfwd.h:371:41: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp&, const _Tp&, _Compare);
                                         ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/algorithmfwd.h:394:30: error: macro "min" requires 2 arguments, but only 1 given
     min(initializer_list<_Tp>);
                              ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/algorithmfwd.h:402:30: error: macro "max" requires 2 arguments, but only 1 given
     max(initializer_list<_Tp>);
                              ^

In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/random:43:0,
                 from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algo.h:65,
                 from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:62,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:309:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:313:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:376:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return false; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:379:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return true; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:383:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:445:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:448:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:452:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:512:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:515:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:519:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:582:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:585:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:589:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:655:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:658:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:662:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:724:11: error: macro "min" requires 2 arguments, but only 1 given
       min() noexcept { return __glibcxx_min (char16_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:727:11: error: macro "max" requires 2 arguments, but only 1 given
       max() noexcept { return __glibcxx_max (char16_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:730:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:785:11: error: macro "min" requires 2 arguments, but only 1 given
       min() noexcept { return __glibcxx_min (char32_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:788:11: error: macro "max" requires 2 arguments, but only 1 given
       max() noexcept { return __glibcxx_max (char32_t); }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:791:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:847:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; }
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/limits:850:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; }
           ^

.
.
.
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:4943:54: error: macro “max” requires 2 arguments, but only 1 given
{ return std::numeric_limits<result_type>::max(); }
^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5138:11: error: macro "min" requires 2 arguments, but only 1 given
       min() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5145:11: error: macro "max" requires 2 arguments, but only 1 given
       max() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5146:54: error: macro "max" requires 2 arguments, but only 1 given
       { return std::numeric_limits<result_type>::max(); }
                                                      ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5364:11: error: macro "min" requires 2 arguments, but only 1 given
       min() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5371:11: error: macro "max" requires 2 arguments, but only 1 given
       max() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5627:11: error: macro "min" requires 2 arguments, but only 1 given
       min() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5637:11: error: macro "max" requires 2 arguments, but only 1 given
       max() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5897:11: error: macro "min" requires 2 arguments, but only 1 given
       min() const
           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.h:5907:11: error: macro "max" requires 2 arguments, but only 1 given
       max() const
           ^

In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/random:52:0,
                 from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algo.h:65,
                 from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:62,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:749:14: error: macro "max" requires 2 arguments, but only 1 given
  = (_M_b.max() - _M_b.min() < std::numeric_limits<_Eresult_type>::max()
              ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:749:27: error: macro "min" requires 2 arguments, but only 1 given
  = (_M_b.max() - _M_b.min() < std::numeric_limits<_Eresult_type>::max()
                           ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:749:71: error: macro "max" requires 2 arguments, but only 1 given
  = (_M_b.max() - _M_b.min() < std::numeric_limits<_Eresult_type>::max()
                                                                       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:750:16: error: macro "max" requires 2 arguments, but only 1 given
     ? _M_b.max() - _M_b.min() + 1 : 0);
                ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:750:29: error: macro "min" requires 2 arguments, but only 1 given
     ? _M_b.max() - _M_b.min() + 1 : 0);
                             ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:795:30: error: macro "min" requires 2 arguments, but only 1 given
      __u = _M_b() - _M_b.min();
                              ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:803:30: error: macro "min" requires 2 arguments, but only 1 given
      __u = _M_b() - _M_b.min();
                              ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:820:44: error: macro "min" requires 2 arguments, but only 1 given
       size_t __j = __k * ((_M_y - _M_b.min())
                                            ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:821:18: error: macro "max" requires 2 arguments, but only 1 given
      / (_M_b.max() - _M_b.min() + 1.0L));
                  ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:821:31: error: macro "min" requires 2 arguments, but only 1 given
      / (_M_b.max() - _M_b.min() + 1.0L));
                               ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:888:40: error: macro "min" requires 2 arguments, but only 1 given
  const __uctype __urngmin = __urng.min();
                                        ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:889:40: error: macro "max" requires 2 arguments, but only 1 given
  const __uctype __urngmax = __urng.max();
                                        ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:957:40: error: macro "min" requires 2 arguments, but only 1 given
  const __uctype __urngmin = __urng.min();
                                        ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:958:40: error: macro "max" requires 2 arguments, but only 1 given
  const __uctype __urngmax = __urng.max();
                                        ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:1142:45: error: macro "max" requires 2 arguments, but only 1 given
       auto __limit = __p.p() * (__aurng.max() - __aurng.min());
                                             ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:1142:61: error: macro "min" requires 2 arguments, but only 1 given
       auto __limit = __p.p() * (__aurng.max() - __aurng.min());
                                                             ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:1145:36: error: macro "min" requires 2 arguments, but only 1 given
  *__f++ = (__aurng() - __aurng.min()) < __limit;
                                    ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:1185:39: error: macro "max" requires 2 arguments, but only 1 given
    std::numeric_limits<_IntType>::max() + __naf;
                                       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:1213:39: error: macro "max" requires 2 arguments, but only 1 given
    std::numeric_limits<_IntType>::max() + __naf;
                                       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:3469:67: error: macro "max" requires 2 arguments, but only 1 given
       const long double __r = static_cast<long double>(__urng.max())
                                                                   ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:3470:46: error: macro "min" requires 2 arguments, but only 1 given
        - static_cast<long double>(__urng.min()) + 1.0L;
                                              ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/random.tcc:3477:45: error: macro "min" requires 2 arguments, but only 1 given
    __sum += _RealType(__urng() - __urng.min()) * __tmp;
                                             ^

In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:62:0,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algo.h:4221:34: error: macro "min" requires 2 arguments, but only 1 given
     min(initializer_list<_Tp> __l)
                                  ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algo.h:4231:34: error: macro "max" requires 2 arguments, but only 1 given
     max(initializer_list<_Tp> __l)
                                  ^

In file included from ../inc/application.h:29:0,
                 from StringBuilder.h:5,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected unqualified-id before 'const'
     min(const _Tp& __a, const _Tp& __b)
     ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected initializer before 'const'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected unqualified-id before 'const'
     max(const _Tp& __a, const _Tp& __b)
     ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected initializer before 'const'
In file included from /usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/algorithm:61:0,
                 from StringBuilder.h:6,
                 from StringBuilder.cpp:1:
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: 'std::min' declared as an 'inline' variable
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: template declaration of 'const _Tp& std::min'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected primary-expression before 'if'
       if (__comp(__b, __a))
       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected '}' before 'if'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:244:7: error: expected unqualified-id before 'return'
       return __a;
       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: 'max' declared as an 'inline' variable
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: template declaration of 'const _Tp& max'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected primary-expression before 'if'
       if (__comp(__a, __b))
       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected '}' before 'if'
/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:265:7: error: expected unqualified-id before 'return'
       return __a;
       ^

/usr/local/gcc-arm-embedded-gcc-arm-none-eabi-4_8-2014q2-20140609-linux-tar-bz2/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:266:5: error: expected declaration before '}' token
     }
     ^

make: *** [StringBuilder.o] Error 1

Hi @blakevh

It looks like you are running into the problem where Arduino min and max are defined as macros and this conflicts with a method in a class you are using. Try adding

#undef min
#undef max

to your headers or top of your main .ino file.

1 Like

This is fixed in the develop branch, will be available for the Core in the web ide with 0.4.5 release.

1 Like

Cool bko, doing this works:

#include “application.h”
#undef min
#undef max
#include <algorithm>

Thanks.

2 Likes