katyo / aubio-rs

Rust bindings for Aubio library
36 stars 6 forks source link

Failing to build a project that depends on aubio-rs #27

Open glocq opened 1 month ago

glocq commented 1 month ago

I'm trying to build a project that depends on aubio-rs, but compilation fails. here is the output of the build command.

The problem seems to come from the compilation of the original C library, as evidenced by line 1554 of the attached output file:

  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "aubio/src" "-Wall" "-Wextra" "-std=c99" "-DHAVE_MEMCPY_HACKS" "-DHAVE_STDLIB_H" "-DHAVE_STDIO_H" "-DHAVE_COMPLEX_H" "-DHAVE_MATH_H" "-DHAVE_STRING_H" "-DHAVE_ERRNO_H" "-DHAVE_LIMITS_H" "-DHAVE_STDARG_H" "-DHAVE_C99_VARARGS_MACROS" "-DNDEBUG" "-o" "/home/gregoire/Documents/code/sandbox/aeolus/target/release/build/aubio-sys-da284238ce3c19e6/out/e0a18ef3a9bf9bda-strutils.o" "-c" "aubio/src/utils/strutils.c" with args cc did not execute successfully (status code exit status: 1).

More specifically, the problem seems to arise when invoking the function strncasecmp, which is not found; see lines 1506-1514 in the attached file:

  cargo:warning=aubio/src/utils/strutils.c: In function ‘aubio_str_extension_matches’:
  cargo:warning=aubio/src/utils/strutils.c:39:29: error: implicit declaration of function ‘strncasecmp’; did you mean ‘strncmp’? [-Wimplicit-function-declaration]
  cargo:warning=   39 |   return ext && pattern && (strncasecmp(ext, pattern, PATH_MAX) == 0);
  cargo:warning=      |                             ^~~~~~~~~~~
  cargo:warning=      |                             strncmp
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 1

I have a feeling that this might be due to something wrong with my setup, so here are some more details:

glocq commented 1 month ago

Some new info: I just tried building a minimal project* and got the same issue. So the issue isn't related to the specifics of my project (although it might still be related to the specifics of my system).

* I created a minimal project by running cargo init and then adding aubio = "0.2.1" to the [dependencies] section in Cargo.toml