Skip to content

error: implicit declaration of function ‘PyObject_AsWriteBuffer’ #15

@papoteur-mga

Description

@papoteur-mga

Hello,
Building with GCC 15, we get this error.

+ TMPDIR=/home/pterjan/rpmbuild/BUILD/python-cwiid-3.0.0-build/cwiid-3.0.0/.pyproject-builddir
+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_wheel.py /home/pterjan/rpmbuild/BUILD/python-cwiid-3.0.0-build/cwiid-3.0.0/pyproject-wheeldir
Processing /home/pterjan/rpmbuild/BUILD/python-cwiid-3.0.0-build/cwiid-3.0.0
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: cwiid
  Building wheel for cwiid (pyproject.toml): started
  Running command Building wheel for cwiid (pyproject.toml)
  Wiimote.c: In function ‘Wiimote_init’:
  Wiimote.c:212:13: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
    212 |             PyEval_InitThreads();
        |             ^~~~~~~~~~~~~~~~~~
  In file included from /usr/include/python3.13/Python.h:124,
                   from Wiimote.c:23:
  /usr/include/python3.13/ceval.h:114:37: note: declared here
    114 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
        |                                     ^~~~~~~~~~~~~~~~~~
  Wiimote.c: In function ‘Wiimote_read’:
  Wiimote.c:804:13: error: implicit declaration of function ‘PyObject_AsWriteBuffer’; did you mean ‘PyObject_GetBuffer’? [-Wimplicit-function-declaration]
    804 |         if (PyObject_AsWriteBuffer(pyRetBuf, &buf, &len)) {
        |             ^~~~~~~~~~~~~~~~~~~~~~
        |             PyObject_GetBuffer
  error: command '/usr/bin/gcc' failed with exit code 1
  error: subprocess-exited-with-error

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