Skip to content

installation fails on mac due to c++11 not being used #76

Closed
@bzamecnik

Description

@bzamecnik

It fails like in https://stackoverflow.com/questions/45047508/error-unknown-type-name-constexpr-during-make-in-mac-os-x:

 FAILED: src/cpp/document.cpython-310-darwin.so.p/document.cpp.o
c++ -Isrc/cpp/document.cpython-310-darwin.so.p -Isrc/cpp -I../../src/cpp -I../../subprojects/pybind11-2.10.3/include -I/opt/homebrew/Cellar/poppler/23.04.0/include/poppler/cpp -I/opt/homebrew/Cellar/poppler/23.04.0/include/poppler -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -fvisibility=hidden -fvisibility-inlines-hidden -fcolor-diagnostics -DNDEBUG -Wall -Winvalid-pch -O3 -MD -MQ src/cpp/document.cpython-310-darwin.so.p/document.cpp.o -MF src/cpp/document.cpython-310-darwin.so.p/document.cpp.o.d -o src/cpp/document.cpython-310-darwin.so.p/document.cpp.o -c ../../src/cpp/document.cpp

      ../../subprojects/pybind11-2.10.3/include/pybind11/detail/common.h:547:15: error: unknown type name 'constexpr'
      inline static constexpr size_t size_in_ptrs(size_t s) {

To fix it add default_options : ['c_std=c11', 'cpp_std=c++11'] to project() in meson.build:

project(
    'python-poppler', 
    'cpp', 
    version: '0.4.0', 
    license: 'GNU General Public License v2 (GPLv2)', 
    # license_files: 'LICENSE.txt',
    meson_version: '>=1.0.0',
    default_options : ['c_std=c11', 'cpp_std=c++11']
)

Then installation works:

$ pip3 install meson meson-python
$ pip3 install python_poppler

Successfully installed python-poppler-0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions