Sorry for the generic title, but I am no pro when it comes to C++ compiling and I can\'t seem to find the error here.
I am checking out an official project, so I kno
C++'s standard library does not use or define max
or min
as macros. The line where the first error is reported (/usr/include/c++/4.4/bits/algorithmfwd.h:353
) contains a forward declaration for the std::max template function with a third parameter. From what I can see in the infos you gave, I'd reckon that on your system some old header is included, which defines max()
and min()
as macros. A common problem, by the way.
You'll need to identify the header (or source file) which defines max
/min
and try to figure out if there is a way to configure the source code to build without that header.
UPDATE: Looks like the culprits are in the 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 usually mean that the code needs cleanup anyway, so you could start by removing the macros and replacing max
/min
with std::max
/std::min
.
The ddraw.lib is actually not used by the software, so you can safely remove ddraw.lib from the list of libraries linker used and the solution will build successfully.