Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error with GCC-11 #91

Closed
dbgrande opened this issue Sep 22, 2021 · 1 comment
Closed

Compiler error with GCC-11 #91

dbgrande opened this issue Sep 22, 2021 · 1 comment

Comments

@dbgrande
Copy link

dbgrande commented Sep 22, 2021

When I try compiling your voxglitch plugin with GCC-11 (linux) I get the following errors:

src/Common/AudioFile.h:586:73: error: ‘numeric_limits’ is not a member of ‘std’
  586 | sample = (T) sampleAsInt / static_cast<float> (std::numeric_limits<std::int32_t>::max());
...

I was able to fix it with the following:

diff --git a/src/Common/AudioFile.h b/src/Common/AudioFile.h
index 1eda1f0..766f8e3 100644
--- a/src/Common/AudioFile.h
+++ b/src/Common/AudioFile.h
@@ -31,6 +31,7 @@
 #include <unordered_map>
 #include <iterator>
 #include <algorithm>
+#include <limits>
 
 // disable some warnings on Windows
 #if defined (_MSC_VER)

Based on the following from: https://www.gnu.org/software/gcc/gcc-11/porting_to.html

Header dependency changes
Some C++ Standard Library headers have been changed to no longer include other headers that they do need to depend on. As such, C++ programs that used standard library components without including the right headers will no longer compile.

The following headers are used less widely in libstdc++ and may need to be included explicitly when compiled with GCC 11:
• <limits> (for std::numeric_limits)
• <memory> (for std::unique_ptr, std::shared_ptr etc.)
• <utility> (for std::pair, std::tuple_size, std::index_sequence etc.)
• <thread> (for members of namespace std::this_thread.)

@clone45
Copy link
Owner

clone45 commented Oct 10, 2021

This has been fixed and should be released soon! Thanks for not only submitting this bug, but showing me how to fix it!

@clone45 clone45 closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants