steinbergmedia / vst3sdk

VST 3 Plug-In SDK
Other
1.64k stars 163 forks source link

Unable to build using gcc 13 #112

Closed dvzrv closed 1 year ago

dvzrv commented 1 year ago

Hi! I'm unable to build projects (e.g. audacity) relying on vst3sdk using gcc 13 on Arch Linux:

[ 42%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/state/invalidstatetransition.cpp.o
In file included from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.h:40,
                 from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:38:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:78:17: error: ‘uint32_t’ does not name a type
   78 |                 uint32_t flags {0};
      |                 ^~~~~~~~
[ 42%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/state/repeatidenticalstatetransition.cpp.o
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:42:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   41 | #include <vector>
  +++ |+#include <cstdint>
   42 |
[ 43%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/state/validstatetransition.cpp.o
[ 43%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/testbase.cpp.o
[ 44%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/unit/checkunitstructure.cpp.o
[ 44%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/unit/scanprograms.cpp.o
In file included from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.h:40,
                 from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:38:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:78:17: error: ‘uint32_t’ does not name a type
   78 |                 uint32_t flags {0};
      |                 ^~~~~~~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:42:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   41 | #include <vector>
  +++ |+#include <cstdint>
   42 |
In file included from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.h:40,
                 from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.cpp:38:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:78:17: error: ‘uint32_t’ does not name a type
   78 |                 uint32_t flags {0};
      |                 ^~~~~~~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:42:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   41 | #include <vector>
  +++ |+#include <cstdint>
   42 |
[ 44%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/unit/scanunits.cpp.o
[ 45%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/testsuite/vsttestsuite.cpp.o
[ 46%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/source/main.cpp.o
[ 46%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/utility/testing.cpp.o
[ 46%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/source/usediids.cpp.o
[ 46%] Built target sdk
[ 47%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/source/validator.cpp.o
[ 47%] Building CXX object public.sdk/samples/vst-hosting/validator/CMakeFiles/validator.dir/__/__/__/source/vst/hosting/module_linux.cpp.o
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘T Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::getInteger(const JSON::Value&) const’:
/usr/src/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 ()) ||
      |                                                                         ^~~~~~~~~~~~~~
/usr/src/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 ()) ||
      |                                                                                         ^
/usr/src/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++/13.1.1/string:51,
                 from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:40:
/usr/include/c++/13.1.1/bits/stl_algobase.h:303:5: note: ‘std::max’ declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/src/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 ()))
      |                                                                         ^~~~~~~~~~~~~~
/usr/src/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 ()))
      |                                                                                         ^
/usr/src/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++/13.1.1/bits/stl_algobase.h:281:5: note: ‘std::min’ declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘void Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::parseClasses(const JSON::Value&)’:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:304:44: error: ‘struct Steinberg::ModuleInfo::ClassInfo’ has no member named ‘flags’
  304 |                                         ci.flags = getInteger<uint32_t> (el.value ());
      |                                            ^~~~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘T Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::getInteger(const JSON::Value&) const’:
/usr/src/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 ()) ||
      |                                                                         ^~~~~~~~~~~~~~
/usr/src/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 ()) ||
      |                                                                                         ^
/usr/src/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++/13.1.1/string:51,
                 from /usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfo.h:40:
/usr/include/c++/13.1.1/bits/stl_algobase.h:303:5: note: ‘std::max’ declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/src/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 ()))
      |                                                                         ^~~~~~~~~~~~~~
/usr/src/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 ()))
      |                                                                                            ^~~
      |                                                                                            std::min
/usr/include/c++/13.1.1/bits/stl_algobase.h:281:5: note: ‘std::min’ declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp: In member function ‘void Steinberg::ModuleInfoLib::{anonymous}::ModuleInfoJsonParser::parseClasses(const JSON::Value&)’:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfoparser.cpp:304:44: error: ‘struct Steinberg::ModuleInfo::ClassInfo’ has no member named ‘flags’
  304 |                                         ci.flags = getInteger<uint32_t> (el.value ());
      |                                            ^~~~~
make[2]: *** [public.sdk/samples/vst-utilities/moduleinfotool/CMakeFiles/moduleinfotool.dir/build.make:104: public.sdk/samples/vst-utilities/moduleinfotool/CMakeFiles/moduleinfotool.dir/__/__/__/source/vst/moduleinfo/moduleinfoparser.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.cpp: In lambda function:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.cpp:188:58: error: ‘const struct Steinberg::ModuleInfo::ClassInfo’ has no member named ‘flags’
  188 |         w.keyValue ("Class Flags", [&] () { w.value (cls.flags); });
      |                                                          ^~~~~
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.cpp: In function ‘Steinberg::ModuleInfo Steinberg::ModuleInfoLib::createModuleInfo(const VST3::Hosting::Module&, bool)’:
/usr/src/vst3sdk/public.sdk/source/vst/moduleinfo/moduleinfocreator.cpp:271:35: error: ‘struct Steinberg::ModuleInfo::ClassInfo’ has no member named ‘flags’
  271 |                         classInfo.flags = ci.classFlags ();
      |                                   ^~~~~
dvzrv commented 1 year ago

As pull requests are ignored in this repository anyways, here's an inline patch for anyone running into this issue:

diff --git i/source/vst/moduleinfo/moduleinfo.h w/source/vst/moduleinfo/moduleinfo.h
index ecf528b..49f2827 100644
--- i/source/vst/moduleinfo/moduleinfo.h
+++ w/source/vst/moduleinfo/moduleinfo.h
@@ -39,6 +39,7 @@

 #include <string>
 #include <vector>
+#include <cstdint>

 //------------------------------------------------------------------------
 namespace Steinberg {
diff --git i/source/vst/moduleinfo/moduleinfoparser.h w/source/vst/moduleinfo/moduleinfoparser.h
index 910cbf5..e052ac2 100644
--- i/source/vst/moduleinfo/moduleinfoparser.h
+++ w/source/vst/moduleinfo/moduleinfoparser.h
@@ -41,6 +41,7 @@
 #include <iostream>
 #include <optional>
 #include <string_view>
+#include <limits>

 //------------------------------------------------------------------------
 namespace Steinberg::ModuleInfoLib {
ygrabit commented 1 year ago

This will be fixed in next update. Thanks