compiler construction - Can't compile C++ project (macro "max" passed 3 arguments, but takes just 2) -
sorry generic title, no pro when comes c++ compiling , can't seem find error here.
i checking out official project, know thing should compile fine. doesn't.
if wants checkout code themselves, here go:
cvs -d :pserver:jvtuser:jvt.amd.2@garcon.ient.rwth-aachen.de:/cvs/jvt login cvs -d :pserver:jvtuser@garcon.ient.rwth-aachen.de:/cvs/jvt checkout jmvc cd jmvc/jmvc/h264extension/build/linux make
when call make
, receive:
make -c lib/h264avcvideoiolib release make[1]: entering directory `/home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib' g++ -c -mmd -mf ./objects/h264avcvideoiolib.r.d -mt ./objects/h264avcvideoiolib.r.o -fpic -dmsys_linux -d_largefile64_source -d_file_offset_bits=64 -dmsys_unix_largefile -i/home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include -i../../../../src/lib/h264avcvideoiolib -dmerl_view -wall -wshadow -wno-reorder -wno-sign-compare -o3 -ffloat-store -dndebug -wuninitialized -o objects/h264avcvideoiolib.r.o /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp in file included /usr/include/c++/4.4/bits/stl_algo.h:61, /usr/include/c++/4.4/algorithm:62, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:56, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /usr/include/c++/4.4/bits/algorithmfwd.h:353: error: macro "max" passed 3 arguments, takes 2 /usr/include/c++/4.4/bits/algorithmfwd.h:364: error: macro "min" passed 3 arguments, takes 2 in file included /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h:9, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:9, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:45, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memaccessor.h: in member function ‘void memaccesslist<t>::copypayload(t*&, uint&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memaccessor.h:207: error: ‘::memcpy’ has not been declared in file included /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:9, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:45, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h: in copy constructor ‘memcont<t>::memcont(const memcont<t>&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h:68: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h: in member function ‘memcont<t>& memcont<t>::operator=(const memcont<t>&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h:113: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h: in member function ‘void memcont<t>::release(t*&, uint&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memcont.h:221: error: ‘::memcpy’ has not been declared in file included /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:45, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h: in copy constructor ‘memlist<t>::memlist(const memlist<t>&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:31: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h: in member function ‘memlist<t>& memlist<t>::operator=(const memlist<t>&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:68: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h: in member function ‘void memlist<t>::release(t*&, uint&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:129: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:151: error: ‘::memcpy’ has not been declared /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h: in member function ‘void memlist<t>::release(t*&, uint&, t*&, uint&)’: /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/memlist.h:181: error: ‘::memcpy’ has not been declared in file included /usr/include/c++/4.4/bits/stl_algo.h:61, /usr/include/c++/4.4/algorithm:62, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:56, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /usr/include/c++/4.4/bits/algorithmfwd.h: @ global scope: /usr/include/c++/4.4/bits/algorithmfwd.h:349: error: expected unqualified-id before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:349: error: expected ‘)’ before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:349: error: expected ‘)’ before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:349: error: expected initializer before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:353: error: template declaration of ‘const _tp& std::max’ /usr/include/c++/4.4/bits/algorithmfwd.h:360: error: expected unqualified-id before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:360: error: expected ‘)’ before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:360: error: expected ‘)’ before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:360: error: expected initializer before ‘const’ /usr/include/c++/4.4/bits/algorithmfwd.h:364: error: template declaration of ‘const _tp& std::min’ in file included /usr/include/c++/4.4/algorithm:62, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avccommonif.h:56, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../include/h264avcvideoiolib.h:5, /home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib/../../../../src/lib/h264avcvideoiolib/h264avcvideoiolib.cpp:2: /usr/include/c++/4.4/bits/stl_algo.h: in function ‘void std::__merge_sort_loop(_randomaccessiterator1, _randomaccessiterator1, _randomaccessiterator2, _distance)’: /usr/include/c++/4.4/bits/stl_algo.h:3239: error: expected unqualified-id before ‘(’ token /usr/include/c++/4.4/bits/stl_algo.h: in function ‘void std::__merge_sort_loop(_randomaccessiterator1, _randomaccessiterator1, _randomaccessiterator2, _distance, _compare)’: /usr/include/c++/4.4/bits/stl_algo.h:3263: error: expected unqualified-id before ‘(’ token make[1]: *** [objects/h264avcvideoiolib.r.o] error 1 make[1]: leaving directory `/home/user/jmvc/jmvc/jmvc/h264extension/build/linux/lib/h264avcvideoiolib' make: *** [release] error 2
just fyi, i'm using g++:
using built-in specs. target: i686-linux-gnu configured with: ../src/configure -v --with-pkgversion='ubuntu/linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/readme.bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu thread model: posix gcc version 4.4.5 (ubuntu/linaro 4.4.4-14ubuntu5)
... , gcc:
using built-in specs. target: i686-linux-gnu configured with: ../src/configure -v --with-pkgversion='ubuntu/linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/readme.bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu thread model: posix gcc version 4.4.5 (ubuntu/linaro 4.4.4-14ubuntu5)
i'd thankful if had pointers...
c++'s standard library not use or define max
or min
macros. line first error reported (/usr/include/c++/4.4/bits/algorithmfwd.h:353
) contains forward declaration std::max template function third parameter. can see in infos gave, i'd reckon on system old header included, defines max()
, min()
macros. common problem, way.
you'll need identify header (or source file) defines max
/min
, try figure out if there way configure source code build without header.
update: looks culprits in source files:
> grep -r "#define min" * include/downconverttools.inl:#define min(x, y) ((x)<(y)?(x):(y)) include/h264avccommonlib/globalfunctions.h:#define min(x,y) ((x)<(y)?(x):(y)) include/h264avccommonif.h:#define min(x,y) ((x)<(y)?(x):(y)) src/test/h264avcdecoderlibtest/decoderparameter.h:#define min(x,y) (((x) < (y)) ? (x) : (y)) src/lib/h264avccommonlib/cfmo.cpp://#define min(a,b) ((a)>(b))?b:a
duplicated definitions mean code needs cleanup anyway, start removing macros , replacing max
/min
std::max
/std::min
.
Comments
Post a Comment