undefined reference to `pthread_mutexattr_init'
Closed this issue · 1 comments
Nivratti commented
root@7617aa05521b:/workspace/opencv-dnn-demo/build# make -j4
[ 50%] Building CXX object CMakeFiles/main.dir/main_executable.cpp.o
[100%] Linking CXX executable main
/usr/local/lib/libopencv_core.a(filesystem.cpp.o): In function `cv::plugin::impl::DynamicLib::libraryLoad(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
filesystem.cpp:(.text._ZN2cv6plugin4impl10DynamicLib11libraryLoadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x34): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_domain_create_init_3_0':
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x5b): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x68): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x75): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x280): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x291): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_domain_create_init_3_0+0x2b0): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_string_handle_create_init_3_0':
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x5b): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x68): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x75): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x269): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x27a): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_string_handle_create_init_3_0+0x299): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_counter_create_init_3_0':
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x60): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x6d): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x7a): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x2b8): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x2c9): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_counter_create_init_3_0+0x2e8): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_counter_create_typed_init_3_0':
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x65): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x72): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x7f): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x2b8): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x2c9): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_counter_create_typed_init_3_0+0x2e8): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_fini_ittlib':
ittnotify_static.c:(.text.__itt_fini_ittlib+0x5b): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_fini_ittlib+0x68): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_fini_ittlib+0x75): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_fini_ittlib+0x151): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_fini_ittlib+0x177): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_fini_ittlib+0x1c0): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libittnotify.a(ittnotify_static.c.o): In function `__itt_init_ittlib':
ittnotify_static.c:(.text.__itt_init_ittlib+0x68): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_init_ittlib+0x75): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_init_ittlib+0x82): undefined reference to `pthread_mutexattr_destroy'
ittnotify_static.c:(.text.__itt_init_ittlib+0x371): undefined reference to `pthread_mutexattr_init'
ittnotify_static.c:(.text.__itt_init_ittlib+0x397): undefined reference to `pthread_mutexattr_settype'
ittnotify_static.c:(.text.__itt_init_ittlib+0x3e0): undefined reference to `pthread_mutexattr_destroy'
/usr/local/lib/opencv4/3rdparty/libippiw.a(iw_own.c.o): In function `ownTlsStorage_Init':
iw_own.c:(.text.ownTlsStorage_Init+0x4f): undefined reference to `pthread_mutexattr_init'
iw_own.c:(.text.ownTlsStorage_Init+0x64): undefined reference to `pthread_mutexattr_settype'
iw_own.c:(.text.ownTlsStorage_Init+0x8b): undefined reference to `pthread_mutexattr_destroy'
iw_own.c:(.text.ownTlsStorage_Init+0x234): undefined reference to `pthread_mutexattr_destroy'
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:115: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Nivratti commented
Set -pthread flag in CmakeList.txt
set( CMAKE_CXX_FLAGS " -pthread " )