Skip to content

implicit declaration of function ‘BaseCanvas__on_draw’; #15

@myqrazydream

Description

@myqrazydream

BaseCanvas__on_draw

First trying pip:
sudo -H python3 -m pip install blighty --upgrade

Then the direct github install:
sudo -H python3 -m pip install git+https://github.com/P403n1x87/blighty.git --upgrade

There are a few deprecation warnings that, if I'm not mistaken, having nothing to do with the problem {full output below}. Then the compiler exits with this error:

blighty/x11/atelier.c: In function ‘dispatch_event’:
blighty/x11/atelier.c:191:9: error: implicit declaration of function ‘BaseCanvas__on_draw’; did you mean ‘BaseCanvas__redraw’? [-Wimplicit-function-declaration]
        191 |         BaseCanvas__on_draw(canvas, canvas->context_arg);
            |         ^~~~~~~~~~~~~~~~~~~
            |         BaseCanvas__redraw
      error: command '/usr/bin/x86_64-solus-linux-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for blighty
Failed to build blighty
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (blighty)

Researching and attempting to fix on my own advised checking that all the correct C headers were installed, and I believe I covered all my bases (including installing all necessary dependencies) there. My Python skills are not 733t enough to exactly follow and ascertain the error, though I surmise that somehow the function is being called before it is declared. The python callback is beyond me, for the present time.

Full Output

Collecting git+https://github.com/P403n1x87/blighty.git
  Cloning https://github.com/P403n1x87/blighty.git to /tmp/pip-req-build-iotuqj5x
  Running command git clone --filter=blob:none --quiet https://github.com/P403n1x87/blighty.git /tmp/pip-req-build-iotuqj5x
  Resolved https://github.com/P403n1x87/blighty.git to commit 5c04dd2a2d9774db7cd7d4440fb9012bf4dd5250
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycairo in /usr/lib/python3.11/site-packages (from blighty==3.0.0) (1.27.0)
Building wheels for collected packages: blighty
  Building wheel for blighty (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for blighty (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [64 lines of output]
      /tmp/pip-build-env-97d9pop4/overlay/lib/python3.11/site-packages/setuptools/dist.py:598: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!
      
              ********************************************************************************
              Usage of dash-separated 'include-dirs' will not be supported in future
              versions. Please use the underscore name 'include_dirs' instead.
      
              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        opt = self.warn_dash_deprecation(opt, section)
      /tmp/pip-build-env-97d9pop4/overlay/lib/python3.11/site-packages/setuptools/dist.py:760: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU General Public License v3 (GPLv3)
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/legacy.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/_extended_context.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/_brush.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty
      creating build/lib.linux-x86_64-cpython-311/blighty/x11
      copying blighty/x11/canvas.py -> build/lib.linux-x86_64-cpython-311/blighty/x11
      copying blighty/x11/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty/x11
      creating build/lib.linux-x86_64-cpython-311/blighty/gtk
      copying blighty/gtk/canvas.py -> build/lib.linux-x86_64-cpython-311/blighty/gtk
      copying blighty/gtk/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty/gtk
      running build_ext
      building 'blighty._x11' extension
      creating build/temp.linux-x86_64-cpython-311/blighty/x11
      x86_64-solus-linux-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -I/usr/include -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -fPIC -I/usr/include/cairo/ -I/usr/include/cairo -I/usr/include/python3.11 -c blighty/x11/_x11module.c -o build/temp.linux-x86_64-cpython-311/blighty/x11/_x11module.o -std=c99
      x86_64-solus-linux-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -I/usr/include -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -fPIC -I/usr/include/cairo/ -I/usr/include/cairo -I/usr/include/python3.11 -c blighty/x11/atelier.c -o build/temp.linux-x86_64-cpython-311/blighty/x11/atelier.o -std=c99
      blighty/x11/atelier.c: In function ‘Atelier_init’:
      blighty/x11/atelier.c:107:3: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
        107 |   PyEval_InitThreads();
            |   ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.11/Python.h:95,
                       from blighty/x11/base_canvas.h:26,
                       from blighty/x11/atelier.h:27,
                       from blighty/x11/atelier.c:24:
      /usr/include/python3.11/ceval.h:132:37: note: declared here
        132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
            |                                     ^~~~~~~~~~~~~~~~~~
      blighty/x11/atelier.c: In function ‘dispatch_event’:
      blighty/x11/atelier.c:191:9: error: implicit declaration of function ‘BaseCanvas__on_draw’; did you mean ‘BaseCanvas__redraw’? [-Wimplicit-function-declaration]
        191 |         BaseCanvas__on_draw(canvas, canvas->context_arg);
            |         ^~~~~~~~~~~~~~~~~~~
            |         BaseCanvas__redraw
      error: command '/usr/bin/x86_64-solus-linux-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for blighty
Failed to build blighty
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (blighty)
mcd@wizard ~/blighty $ ^C
mcd@wizard ~/blighty $ history | grep pip
 1409  scrcpy --tcpip
 1411  scrcpy --tcpip=10.0.0.100:5037
 1412  scrcpy --tcpip=10.0.0.102:5037
 1413  scrcpy --tcpip=10.0.0.101:5037
 1417  adb tcpip 5037
 1419  scrcpy --tcpip=192.168.255.12
 1420  scrcpy --tcpip=192.168.255.12:5037
 1533* sudo -H python3 -m pip install git+https://github.com/P403n1x87/blighty.git --upgrade
 1534  history | grep pip
mcd@wizard ~/blighty $ sudo -H python3 -m pip install blighty --upgrade
[sudo] password for mcd:
Collecting blighty
  Using cached blighty-3.0.0.tar.gz (27 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycairo in /usr/lib/python3.11/site-packages (from blighty) (1.27.0)
Building wheels for collected packages: blighty
  Building wheel for blighty (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for blighty (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [64 lines of output]
      /tmp/pip-build-env-_mhy33eg/overlay/lib/python3.11/site-packages/setuptools/dist.py:598: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!
      
              ********************************************************************************
              Usage of dash-separated 'include-dirs' will not be supported in future
              versions. Please use the underscore name 'include_dirs' instead.
      
              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        opt = self.warn_dash_deprecation(opt, section)
      /tmp/pip-build-env-_mhy33eg/overlay/lib/python3.11/site-packages/setuptools/dist.py:760: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU General Public License v3 (GPLv3)
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/_brush.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/_extended_context.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty
      copying blighty/legacy.py -> build/lib.linux-x86_64-cpython-311/blighty
      creating build/lib.linux-x86_64-cpython-311/blighty/x11
      copying blighty/x11/canvas.py -> build/lib.linux-x86_64-cpython-311/blighty/x11
      copying blighty/x11/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty/x11
      creating build/lib.linux-x86_64-cpython-311/blighty/gtk
      copying blighty/gtk/canvas.py -> build/lib.linux-x86_64-cpython-311/blighty/gtk
      copying blighty/gtk/__init__.py -> build/lib.linux-x86_64-cpython-311/blighty/gtk
      running build_ext
      building 'blighty._x11' extension
      creating build/temp.linux-x86_64-cpython-311/blighty/x11
      x86_64-solus-linux-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -I/usr/include -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -fPIC -I/usr/include/cairo/ -I/usr/include/cairo -I/usr/include/python3.11 -c blighty/x11/_x11module.c -o build/temp.linux-x86_64-cpython-311/blighty/x11/_x11module.o -std=c99
      x86_64-solus-linux-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -I/usr/include -mtune=generic -march=x86-64 -g2 -pipe -fPIC -fno-plt -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=32 -fasynchronous-unwind-tables -ftree-vectorize -feliminate-unused-debug-types -Wall -Wno-error -Wp,-D_REENTRANT -fno-semantic-interposition -O3 -falign-functions=32 -fPIC -I/usr/include/cairo/ -I/usr/include/cairo -I/usr/include/python3.11 -c blighty/x11/atelier.c -o build/temp.linux-x86_64-cpython-311/blighty/x11/atelier.o -std=c99
      blighty/x11/atelier.c: In function ‘Atelier_init’:
      blighty/x11/atelier.c:107:3: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
        107 |   PyEval_InitThreads();
            |   ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.11/Python.h:95,
                       from blighty/x11/base_canvas.h:26,
                       from blighty/x11/atelier.h:27,
                       from blighty/x11/atelier.c:24:
      /usr/include/python3.11/ceval.h:132:37: note: declared here
        132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
            |                                     ^~~~~~~~~~~~~~~~~~
      blighty/x11/atelier.c: In function ‘dispatch_event’:
      blighty/x11/atelier.c:191:9: error: implicit declaration of function ‘BaseCanvas__on_draw’; did you mean ‘BaseCanvas__redraw’? [-Wimplicit-function-declaration]
        191 |         BaseCanvas__on_draw(canvas, canvas->context_arg);
            |         ^~~~~~~~~~~~~~~~~~~
            |         BaseCanvas__redraw
      error: command '/usr/bin/x86_64-solus-linux-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for blighty
Failed to build blighty
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (blighty)

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