neatvnc icon indicating copy to clipboard operation
neatvnc copied to clipboard

Threads not found when pulled in as a meson subproject

Open satmandu opened this issue 4 months ago • 3 comments

Weston is pulling in neatvnc as a meson subproject, but the current neatvnc version is having difficulty with figuring out threads support when pulled in as a meson subproject.

I get this error:

 [172/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_enc_interface.c.o
[173/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_pixels.c.o
[174/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_logging.c.o
FAILED: [code=1] subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_logging.c.o 
cc -Isubprojects/neatvnc/libneatvnc.so.0.0.0.p -Isubprojects/neatvnc -I../subprojects/neatvnc -I../subprojects/neatvnc/include -I../subprojects/aml/include -I/usr/local/include/pixman-1 -I/usr/local/include/libdrm -I/usr/local/include/p11-kit-1 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O3 '-DPROJECT_VERSION="v0.9.5-36ef59a (HEAD)"' -D_GNU_SOURCE -fvisibility=hidden -DAML_UNSTABLE_API=1 -Wmissing-prototypes -Wno-unused-parameter -Wno-format-truncation -DNDEBUG -O3 -pipe -ffat-lto-objects -fPIC -fuse-ld=mold -flto=auto -fPIC -MD -MQ subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_logging.c.o -MF subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_logging.c.o.d -o subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_logging.c.o -c ../subprojects/neatvnc/src/logging.c
../subprojects/neatvnc/src/logging.c:28:10: fatal error: threads.h: No such file or directory
   28 | #include <threads.h>
      |          ^~~~~~~~~~~
compilation terminated.
[175/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_server.c.o
[176/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_cursor.c.o
[177/594] Compiling C object subprojects/neatvnc/libneatvnc.so.0.0.0.p/src_damage-refinery.c.o
ninja: build stopped: subcommand failed.

The downstream discussion is here: https://gitlab.freedesktop.org/wayland/weston/-/issues/1049#note_3058377

Happy to help test any changes to help get the weston project working with neatvnc...

satmandu avatar Aug 22 '25 14:08 satmandu

This header should be available if you have a compiler that supports C11. Did you try adding the threads dependency as mvlad suggested?

any1 avatar Aug 22 '25 15:08 any1

How would you recommend we do that? We're using GCC 15.2 to build.

I suspect something is happening such that the build fails as a meson subproject, but the issue might be simpler.

satmandu avatar Aug 22 '25 17:08 satmandu

How would you recommend we do that?

Add the threads dependency to the meson.build file the same way it's done in aml, like mvlad suggested

any1 avatar Aug 22 '25 17:08 any1