xiph / opus

Modern audio compression for the internet.
https://opus-codec.org/
Other
2.25k stars 601 forks source link

undefined reference to `__stack_chk_guard' #138

Open KangLin opened 5 years ago

KangLin commented 5 years ago

Operating system: windows 10 Compiler: C:/Qt/Qt5.12.4/Tools/mingw730_32/bin/i686-w64-mingw32-gcc.exe Compiler versoin: 7.3.0 opus version: 1.3.1

cmake .. -DCMAKE_INSTALL_PREFIX=/d/Source/RabbitIm/ThirdLibrary/build_script/../windows_mingw730_x86_qt5.12.4_Release -DCMAKE_BUILD_TYPE=Release -G"MSYS Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=/d/Source/RabbitIm/ThirdLibrary/build_script/../windows_mingw730_x86_qt5.12.4_Release/../build_script/cmake/platforms/toolchain-mingw.cmake

toolchain-mingw.cmake

The error information: D:/Source/RabbitIm/ThirdLibrary/src/libopus/celt/float_cast.h:130:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]

warning "Replacing these functions with a standard C cast."

      ^~~~~~~

[100%] Linking C shared library libopus.dll CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x34): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x3a2): undefined reference tostack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x111b): undefined reference to `stack_chk_fail' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x125c): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x1274): undefined reference tostack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x12b3): undefined reference to `stack_chk_fail'

petterreinholdtsen commented 5 years ago

[KangLin]

[100%] Linking C shared library libopus.dll CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x34): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x3a2): undefined reference tostack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x111b): undefined reference to `stack_chk_fail' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x125c): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x1274): undefined reference tostack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x12b3): undefined reference to `stack_chk_fail'

According to <URL:https://stackoverflow.com/questions/27290086/gcc-canaries-undefined-reference-to-stack-chk-guard > these are related to the stack protector option for gcc. I guess either you need to turn off that option, or define the two requested global symbols.

-- Happy hacking Petter Reinholdtsen

KangLin commented 5 years ago

Yes, disable it is ok.

aruhela commented 4 years ago

Yes, disable it is ok. What commands did you run to disable it?

xnorpx commented 4 years ago

https://github.com/xiph/opus/commit/b83dd52868326a401c8578041e3dbea439d53f11 should have fixed this.