Description of problem: Trying to compile a c++ program with g++296 fail with undefined reference to pthread functions. Version-Release number of selected component (if applicable): compat-gcc-7.3-2.96.110 compat-gcc-c++-7.3-2.96.110 compat-libstdc++-7.3-2.96.110 compat-libstdc++-devel-7.3-2.96.110 How reproducible: Always. Steps to Reproduce: 1. Create test.cpp which contains: #include <string> int main() { std::string s; return 0; } 2. Run: $ g++296 test.cpp Actual results: /tmp/ccdissG2.o(.__default_alloc_template<true, 0>::_Lock::gnu.linkonce.t.(void)+0x12): In function `__default_alloc_template<true, 0>::_Lock::_Lock(void)': : undefined reference to `pthread_mutex_lock' /tmp/ccdissG2.o(.gnu.linkonce.t._._Q2t24__default_alloc_template2b1i05_Lock+0x13): In function `__default_alloc_template<true, 0>::_Lock::~_Lock(void)': : undefined reference to `pthread_mutex_unlock' collect2: ld returned 1 exit status Expected results: Compiled file in a.out. Additional info: None.
I forgot to say that you can compile successifully with: $ g++296 test.cpp -lpthread But I have doubts if this is the right thing to do.
What glibc do you use? I believe it is fixed in phoebe3/rawhide.
glibc-2.3.1-21. I'll try the rawhide then. Thanks.
No results from retry, assuming it is fixed.