cd-athena / VCA

Video complexity analyzer
GNU General Public License v3.0
77 stars 9 forks source link

error: ‘size_t’ has not been declared while building #48

Closed Ali-Flt closed 2 years ago

Ali-Flt commented 2 years ago

When I run the cmake --build . command I get the following:

$> cmake --build .
[  5%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/vcaLib.cpp.o
In file included from /home/user/VCA/source/lib/vcaLib.cpp:21:
/home/user/VCA/source/lib/vcaLib.h:197:42: error: ‘size_t’ has not been declared
  197 |                                          size_t num_frames);
      |                                          ^~~~~~
make[2]: *** [source/lib/CMakeFiles/vcaLib.dir/build.make:76: source/lib/CMakeFiles/vcaLib.dir/vcaLib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:116: source/lib/CMakeFiles/vcaLib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Here is the output of the cmake ../ command:

-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- VCA version v1.0.0+4-gae74a03
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Detected x86_64 target processor
-- The ASM_NASM compiler identification is NASM
-- Found assembler: /usr/bin/nasm
-- Nasm found. Activating nasm assembly.
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/VCA/build

I have built VCA in an Ubuntu 18.04 machine (GCC version 7.5.0) without any issues but I can't think of any reason why it's not working on my Arch.

gcc -v output:

$> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror --with-build-config=bootstrap-lto --enable-link-serialization=1 gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)

g++ -v output:

$> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror --with-build-config=bootstrap-lto --enable-link-serialization=1 gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)

Distro: Archlinux cmake version 3.23.0 NASM version 2.15.05 gcc version 11.2.0

ChristianFeldmann commented 2 years ago

Hi! Yes this can happen with different compilers since you never know exactly how the inlude dependencies will be resolved. But please note that we can also not add all the different distros to our CI. Anyways this should be solved by adding the right include. Could you test the branch I added here: https://github.com/cd-athena/VCA/pull/49 ?