werman / noise-suppression-for-voice

Noise suppression plugin based on Xiph's RNNoise
GNU General Public License v3.0
4.73k stars 228 forks source link

m1 macbook issue #81

Closed qwag closed 2 years ago

qwag commented 3 years ago
/Users/alex3/Downloads/gitshit/noise-suppression-for-voice/src/vst_plugin/vst2.x/audioeffect.cpp:530:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
                        char temp[2] = {'0' + (char)digit, '\0'};
                                        ^~~~~~~~~~~~~~~~~
/Users/alex3/Downloads/gitshit/noise-suppression-for-voice/src/vst_plugin/vst2.x/audioeffect.cpp:530:20: note: insert an explicit cast to silence this issue
                        char temp[2] = {'0' + (char)digit, '\0'};
                                        ^~~~~~~~~~~~~~~~~
                                        static_cast<char>( )
1 error generated.
make[2]: *** [src/vst_plugin/CMakeFiles/rnnoise_vst.dir/vst2.x/audioeffect.cpp.o] Error 1
make[1]: *** [src/vst_plugin/CMakeFiles/rnnoise_vst.dir/all] Error 2
make: *** [all] Error 2

I'm running an M1 macbook and i'm getting these errors when i try to build the plugin. I'm not a programmer and a friend of mine who is has tried to help me fix this error but more just crop up when we change the problem line of code, so we're a bit stumped. If someone could either send me a build (probably for intel mac would be best as i'm running ableton under rosetta and plugins built for M1 might not play nice with that) or tell me how to fix this that would be great.

werman commented 3 years ago

Could you try? cmake -Bbuild-x64 -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wno-narrowing"

kcoul commented 2 years ago

Alternatively you can add the static cast as suggested: char temp[2] = {static_cast<char>('0' + (char)digit), '\0'};

ctsrc commented 2 years ago

Could you try? cmake -Bbuild-x64 -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wno-narrowing"

I can confirm that this is sufficient in order for the subsequent build steps to complete on a MacBook Pro M1 running macOS Big Sur version 11.5.2, with Xcode 12.5.1 (Build version 12E507).

werman commented 2 years ago

Now there are macOS builds on CI and VST2 headers are no longer used.