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

Podofo build problems with GCC 8.x #116

Open
z16166 opened this issue Dec 16, 2023 · 2 comments
Open

Podofo build problems with GCC 8.x #116

z16166 opened this issue Dec 16, 2023 · 2 comments
Labels
patch welcome A patch for this issue is welcome

Comments

@z16166
Copy link

z16166 commented Dec 16, 2023

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!

@ceztko
Copy link
Contributor

ceztko commented Dec 16, 2023

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 ceztko added the patch welcome A patch for this issue is welcome label Dec 16, 2023
@ceztko
Copy link
Contributor

ceztko commented Dec 16, 2023

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 ceztko changed the title Podofo build problems Podofo build problems with GCC 8.x Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch welcome A patch for this issue is welcome
Projects
None yet
Development

No branches or pull requests

2 participants