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

Fails to build, no "abs" #8

Closed
alexguzman opened this issue Jan 17, 2015 · 3 comments
Closed

Fails to build, no "abs" #8

alexguzman opened this issue Jan 17, 2015 · 3 comments

Comments

@alexguzman
Copy link

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
Copy link
Owner

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
Copy link
Author

Seems to have done the trick.

@dubhater
Copy link
Owner

All right then. Thanks for the report.

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