Linking executables on FreeBSD

Frerich Raabe raabe at kde.org
Wed Oct 24 17:55:48 CEST 2007


On Wednesday 24 October 2007 15:16, you wrote:
> On Friday 19 October 2007, Alexander Neundorf wrote:
> > On Thursday 18 October 2007 20:43, Frerich Raabe wrote:
> > > I just attempted to build a few KDE modules from KDE trunk on my
> > > FreeBSD box and noticed that none of the executables (like, test
> > > programs) which link against Qt worked on FreeBSD. This is because
> > > '-pthread' was missing on the linker line (you use that instead of
> > > '-lpthread' on FreeBSD).
> > >
> > > I attached a patch which I applied to all FindQt4.cmake copies I could
> > > find in my checkout and except for the copy which is in
> > > kdesupport/qca/cmake/modules, it applied nicely and fixed the problem
> > > (for qca, I needed a slightly different patch because the FindQt4.cmake
> > > file is different).
> > >
> > > I don't dare to commit this though as I have not much of a clue how the
> > > build system works. Does this patch look sane?
> >
> > If you look at FindQt4.cmake, you'll find the following two lines almost
> > at the end of the file:
> >
> > FIND_PACKAGE(Threads)
> > SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
> >
> > CMAKE_THREAD_LIBS_INIT should be set to "-pthread" in your case, this
> > should be done by Modules/FindThreads.cmake coming with cmake. Please
> > check which value CMAKE_THREAD_LIBS_INIT has on your system and try to
> > figure out what FindThreads.cmake does on your box.
>
> Any news ?

Oh, sorry for not coming back to you. I must admit that I didn't try your 
suggestion because I got a new laptop and I installed Kubuntu on that (where 
the problem does not exist).

However, it seems that my 'One uses -pthread instead of -lpthread on FreeBSD' 
information was maybe outdated - somebody on #kde-freebsd pointed out that I 
could use '-lpthread' as a configure argument for Qt, and that supposedly 
fixes the problem I had.

- Frerich


More information about the Kde-buildsystem mailing list