Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to link with libgflags_nothreads.so: undefined reference to `pthread_rwlock_unlock' #14

Closed
shrx opened this issue Jan 12, 2017 · 4 comments

Comments

@shrx
Copy link

shrx commented Jan 12, 2017

Building with gcc 6, make fails with:

Linking guetzli
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libgflags_nothreads.so: undefined reference to `pthread_rwlock_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libgflags_nothreads.so: undefined reference to `pthread_rwlock_init'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libgflags_nothreads.so: undefined reference to `pthread_rwlock_destroy'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libgflags_nothreads.so: undefined reference to `pthread_rwlock_wrlock'
collect2: error: ld returned 1 exit status
guetzli.make:103: recipe for target 'bin/Release/guetzli' failed
make[1]: *** [bin/Release/guetzli] Error 1
Makefile:28: recipe for target 'guetzli' failed
make: *** [guetzli] Error 2
@robryk
Copy link
Contributor

robryk commented Jan 12, 2017

This seems bizarre (the nothreads version of gflags using pthreads). Adding -lpthread is a fine workaround. Can you specify what version of gflags you have and where is it from (e.g. what package in what distro?), so that I can bug gflags people about this?

@WyohKnott
Copy link

I have the same bug with gflags version 2.1.2 on Fedora 25 x86_64.

@steffenweber
Copy link

I had the same issue on Gentoo Linux and fixed it by upgrading from gflags 2.1.2 to gflags 2.2.0.

shrx added a commit to shrx/guetzli that referenced this issue Jan 12, 2017
@shrx
Copy link
Author

shrx commented Jan 12, 2017

@robryk I have libgflags-dev 2.1.2-3 (the latest available) installed on Xubuntu 16.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants