steinbergmedia / vst3sdk

VST 3 Plug-In SDK
Other
1.57k stars 162 forks source link

Build error on Linux with gcc 12 #99

Closed cbix closed 1 year ago

cbix commented 1 year ago

When building the SDK on Arch Linux with gcc 12.2.0 I'm getting these errors which did not occur on 3.7.6:

[ 57%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/hosting/module_linux.cpp.o
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘T Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::getInteger(const JSON::Value&) const’:
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:73: error: ‘numeric_limits’ is not a member of ‘std’
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                         ^~~~~~~~~~~~~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:89: error: expected primary-expression before ‘>’ token
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                                         ^
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:92: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                                            ^~~
      |                                                                                            std::max
In file included from /usr/include/c++/12.2.0/string:50,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:40,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.h:40,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:38:
/usr/include/c++/12.2.0/bits/stl_algobase.h:300:5: note: ‘std::max’ declared here
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:73: error: ‘numeric_limits’ is not a member of ‘std’
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                         ^~~~~~~~~~~~~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:89: error: expected primary-expression before ‘>’ token
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                                         ^
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:92: error: ‘::min’ has not been declared; did you mean ‘std::min’?
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                                            ^~~
      |                                                                                            std::min
/usr/include/c++/12.2.0/bits/stl_algobase.h:278:5: note: ‘std::min’ declared here
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
[ 57%] Linking CXX static library ../lib/libsdk.a
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘T Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::getInteger(const JSON::Value&) const’:
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:73: error: ‘numeric_limits’ is not a member of ‘std’
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                         ^~~~~~~~~~~~~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:89: error: expected primary-expression before ‘>’ token
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                                         ^
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:110:92: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  110 |                                 if (result > static_cast<int64_t> (std::numeric_limits<T>::max ()) ||
      |                                                                                            ^~~
      |                                                                                            std::max
In file included from /usr/include/c++/12.2.0/string:50,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:40,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.h:40,
                 from /home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:38:
/usr/include/c++/12.2.0/bits/stl_algobase.h:300:5: note: ‘std::max’ declared here
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:73: error: ‘numeric_limits’ is not a member of ‘std’
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                         ^~~~~~~~~~~~~~
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:89: error: expected primary-expression before ‘>’ token
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                                         ^
/home/florian/build/vst3sdk/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:111:92: error: ‘::min’ has not been declared; did you mean ‘std::min’?
  111 |                                     result < static_cast<int64_t> (std::numeric_limits<T>::min ()))
      |                                                                                            ^~~
      |                                                                                            std::min
/usr/include/c++/12.2.0/bits/stl_algobase.h:278:5: note: ‘std::min’ declared here
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
ygrabit commented 1 year ago

@cbix Did you try to add this include #include <limits>?

rehans commented 1 year ago

I have just built on Manjaro with gcc 12.2 and indeed it fails because of the missing header.

ygrabit commented 1 year ago

ok, thanks we will add it in the next SDK update