[kde-freebsd] -lpthread linking in kdelis4
    George 'Nephrite' Potapov 
    nephrite at inbox.ru
       
    Sat Apr 18 12:13:29 CEST 2009
    
    
  
Hello!
I'm triyng to build KDE4 from port on FreeBSD 7.0-STABLE i386
It has trouble building kdelibs-4.2.2/kjs
Linker exits with error: undefined reference to pthread_attr_get_np
Apparently, the error is caused by not linking to libpthread library.
I fixed it with this crude patch: 
== cut ==
--- CMakeLists.txt.orig	2009-04-18 14:08:25.000000000 +0400
+++ CMakeLists.txt	2009-04-18 14:08:51.000000000 +0400
@@ -196,6 +196,7 @@
    target_link_libraries(${KJSLIBNAME} ${KDEWIN32_LIBRARIES})
 endif(WIN32)
 
+set("CMAKE_THREAD_LIBS_INIT" "-lpthread")
 if(CMAKE_THREAD_LIBS_INIT)
    target_link_libraries(${KJSLIBNAME} ${CMAKE_THREAD_LIBS_INIT})
 endif(CMAKE_THREAD_LIBS_INIT)
== cut ==
I do realise that this is a bad workaround but it worked.
Hope it will help to fix this problem.
PS. Sorry if I wrote to the wrong address but I couldn't figure how to submit an official problem report, so there.
-- 
George 'Nephrite' Potapov <nephrite at inbox.ru>
    
    
More information about the kde-freebsd
mailing list