SamWindell / Signet

Command-line program for bulk editing audio files on Windows, Linux and Mac
BSD 3-Clause "New" or "Revised" License
22 stars 2 forks source link

Build errors #2

Closed davidhealey closed 3 years ago

davidhealey commented 3 years ago

Hello,

I'm just trying to build Signet for the first time on Debian Buster. I'm getting some build errors.

[  4%] Built target fmt
[  6%] Building C object CMakeFiles/third_party_libs.dir/code/third_party_libs/FLAC/src/stream_decoder.c.o
In file included from /home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/stream_decoder.c:44:
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:60:5: error: #error 
 #   error
     ^~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h: In function ‘safe_malloc_mul_3op_’:
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:63:19: error: ‘SIZE_T_MAX’ undeclared (first use in this function); did you mean ‘SIZE_MAX’?
 # define SIZE_MAX SIZE_T_MAX
                   ^~~~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:125:13: note: in expansion of macro ‘SIZE_MAX’
  if(size1 > SIZE_MAX / size2)
             ^~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:63:19: note: each undeclared identifier is reported only once for each function it appears in
 # define SIZE_MAX SIZE_T_MAX
                   ^~~~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:125:13: note: in expansion of macro ‘SIZE_MAX’
  if(size1 > SIZE_MAX / size2)
             ^~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h: In function ‘safe_malloc_mul2add_’:
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:63:19: error: ‘SIZE_T_MAX’ undeclared (first use in this function); did you mean ‘SIZE_MAX’?
 # define SIZE_MAX SIZE_T_MAX
                   ^~~~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:138:13: note: in expansion of macro ‘SIZE_MAX’
  if(size1 > SIZE_MAX / size2)
             ^~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h: In function ‘safe_malloc_muladd2_’:
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:63:19: error: ‘SIZE_T_MAX’ undeclared (first use in this function); did you mean ‘SIZE_MAX’?
 # define SIZE_MAX SIZE_T_MAX
                   ^~~~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:151:13: note: in expansion of macro ‘SIZE_MAX’
  if(size1 > SIZE_MAX / size2)
             ^~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h: In function ‘safe_realloc_mul_2op_’:
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:63:19: error: ‘SIZE_T_MAX’ undeclared (first use in this function); did you mean ‘SIZE_MAX’?
 # define SIZE_MAX SIZE_T_MAX
                   ^~~~~~~~~~
/home/dave/Desktop/Signet/code/third_party_libs/FLAC/src/include/share/alloc.h:193:13: note: in expansion of macro ‘SIZE_MAX’
  if(size1 > SIZE_MAX / size2)
             ^~~~~~~~
make[2]: *** [CMakeFiles/third_party_libs.dir/build.make:232: CMakeFiles/third_party_libs.dir/code/third_party_libs/FLAC/src/stream_decoder.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:150: CMakeFiles/third_party_libs.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
SamWindell commented 3 years ago

Hi David, sadly I don't have a linux machine to build Signet on. I'm pretty certain all it will take is a few minutes fixing some compile-option related errors like this one to get it working though. I've actually just got another machine that I could dual-boot linux onto.

I'm curious about your experience doing audio work on Linux. Do you use it for sample libraries? Maybe you could shoot me an email? info@frozenplain.com

davidhealey commented 3 years ago

Thanks, email on the way!

SamWindell commented 3 years ago

I've got a linux system up and running now and have committed some changes that I believe should help with these errors. I tested it with GCC 9.3.0 and Clang 10, and added an ubuntu test to the CI.

It's also worth mentioning that signet uses magic_enum and so needs to meet the compiler requirements of that lib: https://github.com/Neargye/magic_enum#compiler-compatibility

davidhealey commented 3 years ago

Thanks Sam. The compilation is working fine for me on Debian Buster using Clang (gcc is too old). But I'm hitting an error with linking:

[ 98%] Linking CXX executable tests
/usr/bin/ld: CMakeFiles/common.dir/code/common/audio_data.cpp.o: in function `CLI::detail::check_path(char const*)':
audio_data.cpp:(.text._ZN3CLI6detail10check_pathEPKc[_ZN3CLI6detail10check_pathEPKc]+0x38): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&, std::error_code&)'
/usr/bin/ld: CMakeFiles/common.dir/code/common/audio_data.cpp.o: in function `std::filesystem::__cxx11::path::path<char const*, std::filesystem::__cxx11::path>(char const* const&, std::filesystem::__cxx11::path::format)':
audio_data.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE]+0x64): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/signet.dir/build.make:154: signet] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/signet.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: CMakeFiles/common.dir/code/common/audio_data.cpp.o: in function `CLI::detail::check_path(char const*)':
audio_data.cpp:(.text._ZN3CLI6detail10check_pathEPKc[_ZN3CLI6detail10check_pathEPKc]+0x38): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&, std::error_code&)'
/usr/bin/ld: CMakeFiles/common.dir/code/common/audio_data.cpp.o: in function `std::filesystem::__cxx11::path::path<char const*, std::filesystem::__cxx11::path>(char const* const&, std::filesystem::__cxx11::path::format)':
audio_data.cpp:(.text._ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC2IPKcS1_EERKT_NS1_6formatE]+0x64): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/tests.dir/build.make:154: tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:205: CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
SamWindell commented 3 years ago

Seems to be an issue in version of the CLI11 library that we were using, I've updated to a new version of it which I think will fix this.

davidhealey commented 3 years ago

That did it! Built and linked now, looking forward to playing with this. Thanks!