podofo icon indicating copy to clipboard operation
podofo copied to clipboard

Podofo build problems with GCC 8.x

Open z16166 opened this issue 2 years ago • 2 comments

hello,

Podofo 0.11.0 can't be built with gcc 13.2.0 on "UnionTech OS GNU/Linux 20". Here are some advices to get it built. Tested ok.

  1. Optionally remove "-Wno-unknown-warning-option" from CMAKE_CXX_FLAGS in CMakeLists.txt. This option is not reconized by gcc 13.2.0. But it only warns.

  2. add "-fpermissive" to CMAKE_CXX_FLAGS in CMakeLists.txt. Or it will complains "__builtin_is_constant_evaluated is not delcared", introduced by source file "podofo/3rdparty/numerics/safe_conversions.h".

#define IsConstantEvaluated() (__builtin_is_constant_evaluated())

  1. add "stdc++fs" to PODOFO_LIB_DEPENDS in CMakeLists.txt, to remove all undefined references to std::filesystem symbols.

list(APPEND PODOFO_LIB_DEPENDS "stdc++fs")

Thanks!

z16166 avatar Dec 16 '23 04:12 z16166

add "-fpermissive" to CMAKE_CXX_FLAGS in CMakeLists.txt. Or it will complains "__builtin_is_constant_evaluated is not delcared", introduced by source file "podofo/3rdparty/numerics/safe_conversions.h".

__builtin_is_constant_evaluated is documented, and also it appears to work anyway in gcc 13.2.0 so I believe this not the right fix.

add "stdc++fs" to PODOFO_LIB_DEPENDS in CMakeLists.txt, to remove all undefined references to std::filesystem symbols. list(APPEND PODOFO_LIB_DEPENDS "stdc++fs")

Also this appears to be unnecessary. See cppreference:

Using this library may require additional compiler/linker options. GNU implementation prior to 9.1 requires linking with -lstdc++fs

Are you compiling with CMake? Maybe you are picking an older compiler.

ceztko avatar Dec 16 '23 09:12 ceztko

Almost for sure you are picking an old gcc 8.x compiler, see the test on Wandbox. If you want to produce a patch to support gcc 8.x you are very welcome, because earlier it worked for sure.

ceztko avatar Dec 16 '23 10:12 ceztko