Results 1 to 6 of 6

Thread: CMake and pthreads

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CMake and pthreads

    Quote Originally Posted by Matt Smith
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread - found
    There's nothing wrong here. It didn't find the function it was looking for in libpthreads, so it used libpthread instead.

    Quote Originally Posted by Matt Smith
    CMake Error: Attempt to add link library "-lpthread" to target "/usr/lib/libQtCore.so" which is not built by this project.
    How does your TARGET_LINK_LIBRARIES line look like?
    Last edited by jacek; 3rd September 2006 at 20:24. Reason: typo

  2. #2
    Join Date
    Jan 2006
    Location
    New Malden (near London)
    Posts
    32
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: CMake and pthreads

    Quote Originally Posted by jacek
    There's nothing wrong here. It didn't find the function it was looking for in libpthreads, so it used libpthread instead.


    How does your TARGET_LINK_LIBRARIES line look like?
    Like this:

    Qt Code:
    1. TARGET_LINK_LIBRARIES(
    2. ${QT_LIBRARIES}
    3. ${QT_QTNETWORK_LIBRARIES}
    4. ${QT_QTXML_LIBRARIES}
    5. )
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CMake and pthreads

    It should be:
    Qt Code:
    1. TARGET_LINK_LIBRARIES( program_name ${QT_LIBRARIES} )
    To copy to clipboard, switch view to plain text mode 
    and add
    Qt Code:
    1. SET( QT_USE_QTNETWORK TRUE )
    2. SET( QT_USE_QTXML TRUE )
    To copy to clipboard, switch view to plain text mode 
    before FIND_PACKAGE().

    http://wiki.qtcentre.org/index.php?t...pps_with_CMake

  4. The following user says thank you to jacek for this useful post:

    Matt Smith (3rd September 2006)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.