Menu

Cannot build on Ubuntu 20.04: aafErr.cpp:181:57: error: ISO C++ forbids comparison between pointer and integer

Albert25
2021-05-28
2021-05-28
  • Albert25

    Albert25 - 2021-05-28

    When trying to build AAF-src-1.2.0-DR1 on Ubuntu 20.04, it ends with the error below.

    $ cmake --build .
    [... parts without errors ...]
    Scanning dependencies of target Impl
    [ 11%] Building CXX object ref-impl/src/impl/CMakeFiles/Impl.dir/__/__/aaflib/aaflibwin32.cpp.o
    [ 11%] Building CXX object ref-impl/src/impl/CMakeFiles/Impl.dir/aafErr.cpp.o
    /home/mi/src/AAF-src-1.2.0-DR1/ref-impl/src/impl/aafErr.cpp: In function ‘const char* aafGetErrorString(aafErr_t)’:
    /home/mi/src/AAF-src-1.2.0-DR1/ref-impl/src/impl/aafErr.cpp:181:57: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
      181 |  if (code < 300 && code >= 0 && localErrorStrings[0] != '\0')
          |                                                         ^~~~
    make[2]: *** [ref-impl/src/impl/CMakeFiles/Impl.dir/build.make:76: ref-impl/src/impl/CMakeFiles/Impl.dir/aafErr.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:2668: ref-impl/src/impl/CMakeFiles/Impl.dir/all] Error 2
    make: *** [Makefile:95: all] Error 2
    

    Is there some option I need to add somewhere, or some other way to fix this?

    Thanks.

     
  • Alexey Kharkevich

    Don't know if there a compiler option to turn this off. Will commit a fix but haven't gotten to it yet. The fix is to replace '\0' with NULL in aafErr.cpp:181:57.

     
    👍
    1
    • Albert25

      Albert25 - 2021-05-28

      Indeed, that fixed it. Thanks a lot.

       

Log in to post a comment.