linking against -lcrypto++ fails with clang

Bug #1510859 reported by Jeff Abrahamson on 2015-10-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libcrypto++ (Ubuntu)

Bug Description

The following problem compiles with g++ but not with clang++. I would expect both to work. This used to work with ubuntu 15.04 but fails with ubuntu 15.10. Note that the program is not designed to do anything except tickle the library linking bug that I am reporting.

#include <crypto++/aes.h>
#include <crypto++/base64.h>
#include <crypto++/osrng.h>
#include <crypto++/sha.h>
#include <iostream>
#include <string>

int main(int argc, char *argv[]) {
    std::cout << argc << " - " << argv[0] << std::endl;
    std::string message("test");
    std::string digest;
    CryptoPP::SHA256 hash;
    CryptoPP::StringSource(message, true,
      new CryptoPP::HashFilter(hash,
          new CryptoPP::Base64Encoder(new CryptoPP::StringSink(digest))));

// Fails:
// clang++ -ggdb3 -Wall -Wextra -std=c++14 -o crypt -lcrypto++

// Succeeds:
// g++ -ggdb3 -Wall -Wextra -std=c++14 -o crypt -lcrypto++

I suspect this bug is parallel to (i.e., same etiology) but not a duplicate of

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: libcrypto++-dev 5.6.1-8
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
ApportVersion: 2.19.1-0ubuntu3
Architecture: amd64
CurrentDesktop: i3
Date: Wed Oct 28 11:04:52 2015
 gcc-5-base 5.2.1-22ubuntu2
 libc6 2.21-0ubuntu4
 libcrypto++9v5 5.6.1-8
 libgcc1 1:5.2.1-22ubuntu2
 libstdc++6 5.2.1-22ubuntu2
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-10-23 (4 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: libcrypto++
UpgradeStatus: Upgraded to wily on 2015-10-23 (4 days ago)

Jeff Abrahamson (jeff-purple) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers