dubhater / vapoursynth-mvtools

Motion compensation and stuff
181 stars 27 forks source link

Fails to build, no "abs" #8

Closed alexguzman closed 9 years ago

alexguzman commented 9 years ago

I get the following build error when calling make on OSX.

  CXX      src/GroupOfPlanes.lo
In file included from src/GroupOfPlanes.cpp:20:
In file included from src/GroupOfPlanes.h:21:
src/PlaneOfBlocks.h:208:66: error: use of undeclared identifier 'abs'
  ...sad = (SAD(dctSrc, dctpitch, dctRef, dctpitch) + abs(dctSrc[0]-dctRef[0]...
                                                      ^
src/PlaneOfBlocks.h:215:76: error: use of undeclared identifier 'abs'
  ...int dctsad = (SAD(dctSrc, dctpitch, dctRef, dctpitch)+ abs(dctSrc[0]-dct...
                                                            ^
src/PlaneOfBlocks.h:222:21: error: use of undeclared identifier 'abs'
                if (abs(srcLuma - refLuma) > (srcLuma + refLuma)>>5)
                    ^
src/PlaneOfBlocks.h:232:21: error: use of undeclared identifier 'abs'
                if (abs(srcLuma - refLuma) > (srcLuma + refLuma)>>5)
                    ^
src/PlaneOfBlocks.h:253:21: error: use of undeclared identifier 'abs'
                if (abs(srcLuma - refLuma) > (srcLuma + refLuma)>>5)
                    ^
src/PlaneOfBlocks.h:262:21: error: use of undeclared identifier 'abs'
                if (abs(srcLuma - refLuma) > (srcLuma + refLuma)>>5)
                    ^
src/PlaneOfBlocks.h:280:21: error: use of undeclared identifier 'abs'
                if (abs(srcLuma - refLuma) > (srcLuma + refLuma)>>4)
                    ^
7 errors generated.
make: *** [src/GroupOfPlanes.lo] Error 1
dubhater commented 9 years ago

Does this help?

diff --git a/src/PlaneOfBlocks.h b/src/PlaneOfBlocks.h
index 431c340..04bc284 100644
--- a/src/PlaneOfBlocks.h
+++ b/src/PlaneOfBlocks.h
@@ -18,6 +18,8 @@
 #ifndef __POBLOCKS__
 #define __POBLOCKS__

+#include <cstdlib>
+
 #include "MVInterface.h"
 #include "Interpolation.h"
 #include "CopyCode.h"
alexguzman commented 9 years ago

Seems to have done the trick.

dubhater commented 9 years ago

All right then. Thanks for the report.