pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.34k stars 2.15k forks source link

use of undeclared identifier #4042

Open feimaomiaomiao opened 1 year ago

feimaomiaomiao commented 1 year ago

In file included from src/Thread.cpp:32: src/Thread_POSIX.cpp:94:7: error: use of undeclared identifier 'pthread_getname_np' if (pthread_getname_np(pthread_self(), name, POCO_MAX_TH... ^ 1 error generated. make[1]: *** [/home/xia/office/poco-android/build/rules/compile:44:/home/xia/office/poco-android/Foundation/obj/Android/armeabi-v7a/debug_static/Thread.o] error 1

micheleselea commented 1 year ago

should be in #include that function that is included in Thread_POSIX.h

aleks-f commented 1 year ago

@micheleselea it is included: https://github.com/pocoproject/poco/blob/2a6434a86d9fcf3f41e8d442832051cf3ff6263b/Foundation/include/Poco/Thread_POSIX.h#L28

@feimaomiaomiao you should provide more information; which version of POCO are you using?

possibly you should use prctl(PR_GET_NAME)

micheleselea commented 1 year ago

@aleks-f my preview answer was not a suggestion, I was pinting out that the include already is present in file so I can't understand the compile error about pthread_getname_np