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

cc1: fatal error: freenect.c: #688

Open
TolyaDenisenko opened this issue Jul 20, 2024 · 2 comments
Open

cc1: fatal error: freenect.c: #688

TolyaDenisenko opened this issue Jul 20, 2024 · 2 comments

Comments

@TolyaDenisenko
Copy link

TolyaDenisenko commented Jul 20, 2024

Hello everyone, I'm using Ubuntu. Have a problem. Help me please 😭

sudo python setup.py install
/home/anatoly/libfreenect/wrappers/python/setup.py:2: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import setup
running install
running build
running build_ext
building 'freenect' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c freenect.c -o build/temp.linux-x86_64-3.10/freenect.o -fPIC -I ../../include/ -I /usr/include/libusb-1.0/ -I /usr/local/include/libusb-1.0 -I /usr/local/include -I ../c_sync/ -I /usr/lib/python3/dist-packages/numpy/core/include
cc1: fatal error: freenect.c: Нет такого файла или каталога
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
@TolyaDenisenko
Copy link
Author

TolyaDenisenko commented Jul 20, 2024

now im have next error

sudo python setup.py install
/home/anatoly/libfreenect/wrappers/python/setup.py:2: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import setup
running install
running build
running build_ext
cythoning freenect.pyx to freenect.c
/usr/lib/python3/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/anatoly/libfreenect/wrappers/python/freenect.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
    dev_out.ctx = ctx
    return dev_out

_depth_cb, _video_cb = None, None

cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) noexcept with gil:
                                                                        ^
------------------------------------------------------------

freenect.pyx:324:73: Syntax error in C variable declaration
building 'freenect' extension
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c freenect.c -o build/temp.linux-x86_64-3.10/freenect.o -fPIC -I ../../include/ -I /usr/include/libusb-1.0/ -I /usr/local/include/libusb-1.0 -I /usr/local/include -I ../c_sync/ -I /usr/lib/python3/dist-packages/numpy/core/include
freenect.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
    1 | #error Do not use this file, it is the result of a failed Cython compilation.
      |  ^~~~~
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

@piedar
Copy link
Contributor

piedar commented Jul 29, 2024

Please build the python wrapper with cmake as described in the readme.

cd libfreenect
mkdir build
cd build
cmake .. -DBUILD_PYTHON=ON
make

If you insist on building the wrapper manually, you must choose the appropriate pyx file based on your cython version.

  • cython 0.x => freenect.cython0.pyx
  • cython 3.x => freenect.pyx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants