Bug 730835 - link error against pthread library
link error against pthread library
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: boost (Show other bugs)
15
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Benjamin Kosnik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-15 17:31 EDT by gallo33
Modified: 2013-08-09 01:51 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-16 08:48:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description gallo33 2011-08-15 17:31:57 EDT
Description of problem:
Linking the interprocess boost library against rt library causes the following error:
/usr/bin/ld: note: 'pthread_mutexattr_settype@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation

Version-Release number of selected component (if applicable):
1.46.0

How reproducible:
Just build the first example in the page http://www.boost.org/doc/libs/1_47_0/doc/html/interprocess/quick_guide.html
I tried to link the project with the line:
/usr/lib64/ccache/c++   -g   CMakeFiles/Boost-ICP.dir/src/main.cpp.o  -o Boost-ICP -rdynamic -lrt
Comment 1 Petr Machata 2011-08-16 08:48:36 EDT
You need to compile with -pthread.  Boost.Interprocess is a source-level library, so there's no way for the library itself to "smuggle" the pthread libraries to the command line.

Note You need to log in before you can comment on or make changes to this bug.