8000 [BUG]: symbol not found in flat namespace (__Py_DECREF_DecRefTotal) · Issue #5056 · pybind/pybind11 · GitHub
[go: up one dir, main page]

Skip to content
[BUG]: symbol not found in flat namespace (__Py_DECREF_DecRefTotal) #5056
@DDoS

Description

@DDoS

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

2.11.1

Problem description

I get a single symbol not found issue. I checked that I'm using the same python to compile and run. The only comment I've found that references this error is python/cpython#108562, but it hasn't helped.

EDIT: this is only an issue when creating a debug build.

[py] (main) ! /usr/local/bin/python3.12
Python 3.12.2 (main, Feb 20 2024, 04:30:04) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import py_encre
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(<..>/cadre/build/debug/py/py_encre.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace (__Py_DECREF_DecRefTotal)
//Path to a program.
_Python_EXECUTABLE:INTERNAL=/usr/local/bin/python3.12
//Path to a file.
_Python_INCLUDE_DIR:INTERNAL=/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12
//Python Properties
_Python_INTERPRETER_PROPERTIES:INTERNAL=Python;3;12;2;64;;cpython-312-darwin;abi3;/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib/python3.12;/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib/python3.12;/usr/local/lib/python3.12/site-packages;/usr/local/lib/python3.12/site-packages
_Python_INTERPRETER_SIGNATURE:INTERNAL=4c035cd690ab226aa15325c7c3748186
//Interpreter reason failure
_Python_Interpreter_REASON_FAILURE:INTERNAL=
//Path to a library.
_Python_LIBRARY_RELEASE:INTERNAL=/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib/libpython3.12.dylib

I'm on macOS 12.7.3.

Reproducible example code

Basically an empty module. I stripped out all the code.

cmake_minimum_required(VERSION 3.23)

project("encre" LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(Python 3 COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)

pybind11_add_module(py_encre "src/py_encre.cpp")
#include <pybind11/pybind11.h>

PYBIND11_MODULE(py_encre, m) {
    m.doc() = "Python bindings for Encre";
}

Is this a regression? Put the last known working version here if it is.

Not know to be a regression

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNew bug, unverified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      294C
      0