0

I'm trying to compile Perl bindings to Nvidia Management library (NVML). When I use the makefile, following errors appear:

/usr/lib/powerpc64le-linux-gnu/perl/5.22/CORE/handy.h:117:34: error: ‘bool’ undeclared (first use in this function)
 #define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)

/usr/lib/powerpc64le-linux-gnu/perl/5.22/CORE/handy.h:117:39: error: expected ‘:’ before numeric constant
 #define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)

gcc version is: gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

I've included stdbool.h file in handy.h.

5
  • Do you mean you've edited handy.h manually? Commented Sep 3, 2016 at 13:54
  • yes. Instead, should I add some flag in makefile? Commented Sep 3, 2016 at 14:13
  • What are the preceding 40 or so lines of handy.h? Commented Sep 3, 2016 at 14:55
  • This file already contains plenty of logic to handle bool, you would need to (revert to the original file and) check what exactly is going on, what does HAS_BOOL expand to? I_STDBOOL? PERL_BOOL_AS_CHAR? etc. Commented Sep 3, 2016 at 16:03
  • Yes, from the logic it seems it should handle bool. Has the errors anything to do with gcc version/packages? Also how to check what HAS_BOOL expands to? Commented Sep 5, 2016 at 5:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.