tildearrow / input-modifier

uinput based key bindings and macros tool for Linux
GNU General Public License v2.0
20 stars 6 forks source link

Build fails with `‌‌error: ‘pthread_create’ was not declared in this scope; did you mean ‘timer_create’?`. #10

Open dreirund opened 1 year ago

dreirund commented 1 year ago

I am building release 1.3.5 according to your PKGBUILD.

When I build, build fails with ‌‌error: ‘pthread_create’ was not declared in this scope; did you mean ‘timer_create’?:

[ 33%] Building CXX object CMakeFiles/imodd.dir/src/daemon/listener.cpp.o
/home/[...]/.cache/yay/input-modifier/src/input-modifier-1.3.5/src/daemon/listener.cpp: In member function ‘bool DeviceListener::init()’:
/home/[...]/.cache/yay/input-modifier/src/input-modifier-1.3.5/src/daemon/listener.cpp:27:3: error: ‘pthread_create’ was not declared in this scope; did you mean ‘timer_create’?
   27 |   pthread_create(&thread,NULL,listenThread,this);
      |   ^~~~~~~~~~~~~~
      |   timer_create
make[2]: *** [CMakeFiles/imodd.dir/build.make:132: CMakeFiles/imodd.dir/src/daemon/listener.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/imodd.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

gcc version:‌ 13.1.1 20230429

Regards!

Daemonrat commented 4 months ago

Same issue when trying to build from AUR. tried adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") to CMakeLists.txt and #include <pthread.h> to listener.cpp. No luck.

I was able to build just fine from tar package.