对于通用标题很抱歉,但在C ++编译时我不是专业人士,我似乎无法在这里找到错误。
我正在检查一个官方项目,所以我知道事情应该实际编译得很好。它没有。
如果有人想自己查看代码,请转到:
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
当我致电make
时,我会收到:
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 from /usr/include/c++/4.4/bits/stl_algo.h:61,
from /usr/include/c++/4.4/algorithm:62,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:56,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /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, but takes just 2
/usr/include/c++/4.4/bits/algorithmfwd.h:364: error: macro "min" passed 3 arguments, but takes just 2
In file included from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/MemCont.h:9,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/MemList.h:9,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:45,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /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 from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/MemList.h:9,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:45,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /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 from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:45,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /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 from /usr/include/c++/4.4/bits/stl_algo.h:61,
from /usr/include/c++/4.4/algorithm:62,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:56,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../src/lib/H264AVCVideoIoLib/H264AVCVideoIoLib.cpp:2:
/usr/include/c++/4.4/bits/algorithmfwd.h: At 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 from /usr/include/c++/4.4/algorithm:62,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCCommonIf.h:56,
from /home/user/JMVC/jmvc/JMVC/H264Extension/build/linux/lib/H264AVCVideoIoLib/../../../../include/H264AVCVideoIoLib.h:5,
from /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
只是fyi,我正在使用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)
如果有人提出一些指示,我会非常感激......
答案 0 :(得分:4)
C ++的标准库不使用或定义max
或min
作为宏。报告第一个错误的行(/usr/include/c++/4.4/bits/algorithmfwd.h:353
)包含带有第三个参数的std :: max模板函数的前向声明。从我在您提供的信息中看到的内容,我认为在您的系统中包含了一些旧标头,它将max()
和min()
定义为宏。顺便说一下,这是一个常见问题。
您需要识别定义max
/ min
的标头(或源文件),并尝试确定是否有办法配置源代码以在没有该标头的情况下构建。
<强>更新强> 看起来匪徒在源文件中:
> 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
重复的定义通常意味着代码无论如何都需要清理,因此您可以先删除宏并将max
/ min
替换为std::max
/ std::min
。
答案 1 :(得分:4)
ddraw.lib实际上并未被软件使用,因此您可以安全地从所使用的库链接器列表中删除ddraw.lib,并且解决方案将成功构建。