Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: ‘ptrdiff_t’ was not declared in this scope #499

Closed
rfenouil opened this issue Oct 8, 2019 · 2 comments
Closed

Compilation error: ‘ptrdiff_t’ was not declared in this scope #499

rfenouil opened this issue Oct 8, 2019 · 2 comments

Comments

@rfenouil
Copy link

rfenouil commented Oct 8, 2019

Hello,

I am trying to compile on Ubuntu 19.04 (5.0.0-29-generic).
I get the following error on make:

~/repos/vapoursynth$ make
  CXX      src/filters/misc/libmiscfilters_la-miscfilters.lo
src/filters/misc/miscfilters.cpp: In function ‘void averageFramesByteSSE2(const std::vector<const VSFrameRef*>&, VSFrameRef*, const int*, unsigned int, unsigned int, int, const VSAPI*)’:
src/filters/misc/miscfilters.cpp:199:5: error: ‘ptrdiff_t’ was not declared in this scope
     ptrdiff_t stride = vsapi->getStride(dst, plane);
     ^~~~~~~~~
src/filters/misc/miscfilters.cpp:199:5: note: suggested alternatives:
In file included from /usr/include/c++/6/utility:68:0,
                 from /usr/include/c++/6/algorithm:60,
                 from src/filters/misc/miscfilters.cpp:21:
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
                            ^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
src/filters/misc/miscfilters.cpp:258:25: error: ‘stride’ was not declared in this scope
             srcpv[i] += stride;
                         ^~~~~~
src/filters/misc/miscfilters.cpp:260:17: error: ‘stride’ was not declared in this scope
         dstp += stride;
                 ^~~~~~
src/filters/misc/miscfilters.cpp: In function ‘void averageFramesWordSSE2(const std::vector<const VSFrameRef*>&, VSFrameRef*, const int*, unsigned int, unsigned int, int, const VSAPI*)’:
src/filters/misc/miscfilters.cpp:265:5: error: ‘ptrdiff_t’ was not declared in this scope
     ptrdiff_t stride = vsapi->getStride(dst, plane);
     ^~~~~~~~~
src/filters/misc/miscfilters.cpp:265:5: note: suggested alternatives:
In file included from /usr/include/c++/6/utility:68:0,
                 from /usr/include/c++/6/algorithm:60,
                 from src/filters/misc/miscfilters.cpp:21:
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
                            ^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
src/filters/misc/miscfilters.cpp:320:105: error: ‘stride’ was not declared in this scope
             srcpv[i] = reinterpret_cast<const uint16_t *>(reinterpret_cast<const uint8_t *>(srcpv[i]) + stride);
                                                                                                         ^~~~~~
src/filters/misc/miscfilters.cpp:322:81: error: ‘stride’ was not declared in this scope
         dstp = reinterpret_cast<uint16_t *>(reinterpret_cast<uint8_t *>(dstp) + stride);
                                                                                 ^~~~~~
src/filters/misc/miscfilters.cpp: In function ‘void averageFramesFloatSSE2(const std::vector<const VSFrameRef*>&, VSFrameRef*, const float*, float, int, const VSAPI*)’:
src/filters/misc/miscfilters.cpp:327:5: error: ‘ptrdiff_t’ was not declared in this scope
     ptrdiff_t stride = vsapi->getStride(dst, plane);
     ^~~~~~~~~
src/filters/misc/miscfilters.cpp:327:5: note: suggested alternatives:
In file included from /usr/include/c++/6/utility:68:0,
                 from /usr/include/c++/6/algorithm:60,
                 from src/filters/misc/miscfilters.cpp:21:
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
                            ^~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:202:28: note:   ‘std::ptrdiff_t’
src/filters/misc/miscfilters.cpp:351:102: error: ‘stride’ was not declared in this scope
             srcpv[i] = reinterpret_cast<const float *>(reinterpret_cast<const uint8_t *>(srcpv[i]) + stride);
                                                                                                      ^~~~~~
src/filters/misc/miscfilters.cpp:353:78: error: ‘stride’ was not declared in this scope
         dstp = reinterpret_cast<float *>(reinterpret_cast<uint8_t *>(dstp) + stride);
                                                                              ^~~~~~
make: *** [Makefile:1636: src/filters/misc/libmiscfilters_la-miscfilters.lo] Error 1

If that helps, here is the report from ./configure:

~/repos/vapoursynth$ ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/x86_64-linux-gnu-ld
checking if the linker (/usr/bin/x86_64-linux-gnu-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/x86_64-linux-gnu-ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64
checking if the linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZIMG... yes
checking for library containing dlopen... -ldl
checking for sched_getaffinity... yes
checking for cpuset_getaffinity... no
checking for a Python interpreter with version >= 3... python3
checking for python3... /usr/bin/python3
checking for python3 version... 3.7
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/lib/python3.7/site-packages
checking for python3 extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for PYTHON3... yes
checking for cython3... cython3
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for library containing libiconv_open... no
checking for library containing iconv_open... none required
checking for LIBASS... no
checking for FFMPEG... yes
checking for IMAGEMAGICK... no
checking for TESSERACT... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pc/vapoursynth.pc
config.status: creating pc/vapoursynth-script.pc
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands

Did I forget something obvious ?
Thank you for your help.

@myrsloik
Copy link
Member

myrsloik commented Oct 8, 2019

It's probably just missing cstddef header in miscfilters.cpp. I'll add it later.

@rfenouil
Copy link
Author

rfenouil commented Oct 9, 2019

That did the job indeed, thank you for the suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants