Closed ghost91- closed 8 years ago
What environment are you using for compiling? Codecrypt itself doesn't use pthreads, this dependency should get pulled in by -lcryptopp.
Check out if ldd /usr/lib/libcryptopp.so
outputs pthread (please paste the output here as well for documentation). If not, putting -lpthread manually to LIBS for your ./configure
is a good workaround.
Relating to the other issue, what output do you get from pkg-config libcrypto++ --libs
?
I'm compiling on Arch Linux x86_64. ldd /usr/lib/libcryptopp.so
did not output pthread. I compiled the most recent version of crypto++ and ldd did return pthread when in this case, so i suppose this is either a bug of crypto++ or the arch package.
pkg-config libcrypto++ --libs
returns -lcryptopp
EDIT: I just compiled version 5.6.2 of crypto++ (the version, which is used for the arch package currently) and it seems it is missing the pthread linkage. 5.6.3 has this issue, too, but it seems to be fixed in the git version of crypto++, so I guess it will be fixed with the next release of crypto++. In the mean time I will ask the package maintainer of the arch package to fix this.
Anyway, from debian source package:
~/libcrypto++-5.6.1/debian $ grep pthread changelog
* Link with pthread to avoid warning from dpkg-shlibdeps.
* Use LDFLAGS=-pthread to fix linking errors.
Debian is explicitly fixing this for the package to avoid dependency breakage. Asking either Crypto++ or Arch packaging folks about the reason for this behavior will probably be the best option to solve this.
PS. crypto++ likes the workaround solution better https://www.cryptopp.com/wiki/Linux#Undefined_Reference_to_pthread :disappointed:
Shall be resolved by upstream, closing.
If there's some quick&portable fix/workaround for detection whether cryptopp needs -pthread added, please submit a patch.
When trying to compile codecrypt, i recieved the following errors:
Simply adding "-lpthread" to the linker flags in "autogen.sh" solves this.