[arch-general] crypto++ broken on arch? (unable to link)
#include <cryptopp/sha.h> #include <cryptopp/hex.h> #include <cryptopp/files.h> #include <boost/filesystem.hpp> #include <string> #include <iostream> using namespace std; using namespace boost::filesystem; string getSha1Hash(const path &file, bool uppercase) { string result; CryptoPP::SHA1 hash; CryptoPP::FileSource(file.file_string().c_str(),true, new CryptoPP::HashFilter(hash, new CryptoPP::HexEncoder( new CryptoPP::StringSink(result),uppercase))); return result; } int main() { string sha1; path file("test.txt"); sha1 = getSha1Hash(file, true); cout << sha1 << endl; } g++ -lboost_filesystem-mt -lcryptopp sha1.cpp /tmp/cc5IJR4i.o: In function `getSha1Hash(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, bool)': sha1.cpp:(.text+0x5a): undefined reference to `CryptoPP::StringSinkTemplate<std::basic_string<char, std::char_traits<char>, std::allocator<char> >
::StringSinkTemplate(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' sha1.cpp:(.text+0x117): undefined reference to `CryptoPP::DEFAULT_CHANNEL' sha1.cpp:(.text+0x11d): undefined reference to `CryptoPP::DEFAULT_CHANNEL' sha1.cpp:(.text+0x133): undefined reference to `CryptoPP::HashFilter::HashFilter ...
collect2: ld returned 1 exit status
according to the crypto++ mailing list my code does compile with that command on ubuntu. if I'm doing something wrong for arch I'd like to know. But I'm concerned that something is not being compiled right for crypto++ on arch. -- Caleb Cushing http://xenoterracide.blogspot.com
On Thu, Sep 17, 2009 at 17:03, Caleb Cushing <xenoterracide@gmail.com> wrote:
according to the crypto++ mailing list my code does compile with that command on ubuntu. if I'm doing something wrong for arch I'd like to know. But I'm concerned that something is not being compiled right for crypto++ on arch. -- Caleb Cushing
My guess is either outdated library in ubuntu, which your codes works with, but doesn't work with a newer version, or that gcc/glibc being newer is making it break. It's likely one of those.
My guess is either outdated library in ubuntu, which your codes works with, but doesn't work with a newer version, or that gcc/glibc being newer is making it break. It's likely one of those.
even if it is a bug on there end or with my code. it would be good to figure out exactly what the issue is. -- Caleb Cushing http://xenoterracide.blogspot.com
http://groups.google.com/group/cryptopp-users/browse_thread/thread/dfe40b4ee... discussion can be followed there. still trying to work out what's going code does work against 5.6.0 just not on arch... -- Caleb Cushing http://xenoterracide.blogspot.com
participants (2)
-
Caleb Cushing
-
Daenyth Blank