Bug 730835

Summary: link error against pthread library
Product: [Fedora] Fedora Reporter: gallo33
Component: boostAssignee: Benjamin Kosnik <bkoz>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: bkoz, denis.arnaud_fedora, mnewsome, pertusus, pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:48:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description gallo33 2011-08-15 21:31:57 UTC
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 12:48:36 UTC
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.