Related
I'm trying to utilize Crypto++'s Simon and Speck implementations for a research project, but I currently cannot compile and link the example code provided on its wiki page.
Following the instructions from the Crypto++ wiki, I was able to build the library and run all of their test suites to completion. I have also been able to run example AES code from the same wiki. The compilation errors only come when I try to invoke Simon or Speck.
To compile and link the file I am using g++ speck_test.cpp -lcryptopp.
Here is the program provided on the Crypto++ Speck wiki. I added include statements and scope resolutions where I believed necessary.
#include <iostream>
#include <iomanip>
#include "cryptopp/modes.h"
#include "cryptopp/speck.h"
#include "cryptopp/filters.h"
int main(int argc, char* argv[]) {
CryptoPP::SPECK128::Encryption speck;
std::cout << "StaticAlgorithmName: " << speck.StaticAlgorithmName() << std::endl;
std::cout << "AlgorithmName (unkeyed): " << speck.AlgorithmName() << std::endl;
CryptoPP::byte key[CryptoPP::SPECK128::DEFAULT_KEYLENGTH] = {};
speck.SetKey(key, sizeof(key));
std::cout << "AlgorithmName (keyed): " << speck.AlgorithmName() << std::endl;
return 0;
}
Expected output of this program according to the wiki is
StaticAlgorithmName: SPECK-128
AlgorithmName (unkeyed): SPECK-128
AlgorithmName (keyed): SPECK-128(128)
however, I am receiving the following error from the compiler:
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Base::Base()':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2Ev[_ZN8CryptoPP8SPECK1284BaseC5Ev]+0x2c): undefined reference to `vtable for CryptoPP::SPECK128::Base'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2Ev[_ZN8CryptoPP8SPECK1284BaseC5Ev]+0x3a): undefined reference to `vtable for CryptoPP::SPECK128::Base'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2Ev[_ZN8CryptoPP8SPECK1284BaseC5Ev]+0x49): undefined reference to `vtable for CryptoPP::SPECK128::Base'
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Base::~Base()':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseD2Ev[_ZN8CryptoPP8SPECK1284BaseD5Ev]+0xf): undefined reference to `vtable for CryptoPP::SPECK128::Base'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseD2Ev[_ZN8CryptoPP8SPECK1284BaseD5Ev]+0x1d): undefined reference to `vtable for CryptoPP::SPECK128::Base'
/tmp/ccD02cM7.o:speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseD2Ev[_ZN8CryptoPP8SPECK1284BaseD5Ev]+0x2c): more undefined references to `vtable for CryptoPP::SPECK128::Base' follow
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Enc::Enc()':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2Ev[_ZN8CryptoPP8SPECK1283EncC5Ev]+0x1b): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2Ev[_ZN8CryptoPP8SPECK1283EncC5Ev]+0x29): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2Ev[_ZN8CryptoPP8SPECK1283EncC5Ev]+0x38): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Enc::~Enc()':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncD2Ev[_ZN8CryptoPP8SPECK1283EncD5Ev]+0xf): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncD2Ev[_ZN8CryptoPP8SPECK1283EncD5Ev]+0x1d): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
/tmp/ccD02cM7.o:speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncD2Ev[_ZN8CryptoPP8SPECK1283EncD5Ev]+0x2c): more undefined references to `vtable for CryptoPP::SPECK128::Enc' follow
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x28): undefined reference to `CryptoPP::SPECK128::Base::AlgorithmProvider[abi:cxx11]() const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x30): undefined reference to `CryptoPP::SPECK128::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x38): undefined reference to `CryptoPP::SPECK128::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x40): undefined reference to `CryptoPP::SPECK128::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0xe0): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x128): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Base::AlgorithmProvider[abi:cxx11]() const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x130): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEE]+0x160): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x28): undefined reference to `CryptoPP::SPECK128::Base::AlgorithmProvider[abi:cxx11]() const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x30): undefined reference to `CryptoPP::SPECK128::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x38): undefined reference to `CryptoPP::SPECK128::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x40): undefined reference to `CryptoPP::SPECK128::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0xd8): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x120): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Base::AlgorithmProvider[abi:cxx11]() const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x128): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x158): undefined reference to `non-virtual thunk to CryptoPP::SPECK128::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
/tmp/ccD02cM7.o:(.data.rel.ro._ZTIN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE[_ZTIN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8SPECK1283EncEEES4_EE]+0x10): undefined reference to `typeinfo for CryptoPP::SPECK128::Enc'
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Base::Base(CryptoPP::SPECK128::Base const&)':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2ERKS1_[_ZN8CryptoPP8SPECK1284BaseC5ERKS1_]+0x41): undefined reference to `vtable for CryptoPP::SPECK128::Base'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2ERKS1_[_ZN8CryptoPP8SPECK1284BaseC5ERKS1_]+0x4f): undefined reference to `vtable for CryptoPP::SPECK128::Base'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1284BaseC2ERKS1_[_ZN8CryptoPP8SPECK1284BaseC5ERKS1_]+0x5e): undefined reference to `vtable for CryptoPP::SPECK128::Base'
/tmp/ccD02cM7.o: In function `CryptoPP::SPECK128::Enc::Enc(CryptoPP::SPECK128::Enc const&)':
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2ERKS1_[_ZN8CryptoPP8SPECK1283EncC5ERKS1_]+0x26): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2ERKS1_[_ZN8CryptoPP8SPECK1283EncC5ERKS1_]+0x34): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
speck_test.cpp:(.text._ZN8CryptoPP8SPECK1283EncC2ERKS1_[_ZN8CryptoPP8SPECK1283EncC5ERKS1_]+0x43): undefined reference to `vtable for CryptoPP::SPECK128::Enc'
collect2: error: ld returned 1 exit status
Any help would be very appreciated!
As dave pointed out, the error was arose from the compiler being unable to find CryptoPP.
To fix this, I had to set the LD_LIBRARY_PATH environment variable on Ubuntu to include the path to the library. Then, I had to alter my compiler command to compile my file first, then link the library second, i.e.
g++ -o test.exe speck_test.cpp -L<path-to-cryptopp> -lcryptopp
rather than
g++ -L<path-to-cryptopp> -lcryptopp -o test.exe speck_test.cpp, which was failing.
I have a project that depends on Crypto++ on Debian 8.10. The project has a library (called common that uses Crypto++ ) and the executable (hwinfo). I'm using Cmake for building purposes.
Here is my library build Cmake:
cmake_minimum_required(VERSION 3.2.2)
set (CMAKE_CXX_STANDARD 11)
include_directories()
file(GLOB SOURCES "*.cpp")
project(common)
add_library(common ${SOURCES})
find_library(LIBCRYPTOPP cryptopp)
target_link_libraries(common ${LIBCRYPTOPP})
install(TARGETS common
ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/../../lib
LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/../../lib)
And my executable Cmake file:
cmake_minimum_required(VERSION 3.2.2)
set (CMAKE_CXX_STANDARD 11)
include_directories(../common)
file(GLOB SOURCES "*.cpp")
project(hwinfo)
add_executable(hwinfo ${SOURCES})
find_library(LIBCOMMON common PATHS ${PROJECT_SOURCE_DIR}/../../lib)
find_library(LIBCRYPTOPP cryptopp)
message(STATUS "CRYPTO LIBRARY ===>" ${LIBCRYPTOPP})
message(STATUS "MY COMMON LIBRARY ===>" ${LIBCOMMON})
target_link_libraries(hwinfo ${LIBCRYPTOPP} ${LIBCOMMON})
install(TARGETS hwinfo
RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/../../bin)
From the diagnostic messages in the executable Cmake (message (STATUS...)):
-- CRYPTO LIBRARY ===>/usr/local/lib/libcryptopp.a
-- MY COMMON LIBRARY ===>/home/myself/dev/common/lib/libcommon.a
So, the libraries are being found. Here are the errors I'm getting on compilation. I've cropped some errors otherwise I wouldn't be able to post, but seen that all crypto calls are undefined:
...
[ 64%] Linking CXX executable hwinfo
../../../lib/libcommon.a(Encryptor.cpp.o): In function `common::Encryptor::encrypt(std::string)':
Encryptor.cpp:(.text+0x2a6): undefined reference to `CryptoPP::CipherModeFinalTemplate_ExternalCipher<CryptoPP::CBC_Encryption>::CipherModeFinalTemplate_ExternalCipher(CryptoPP::BlockCipher&, unsigned char const*, int)'
Encryptor.cpp:(.text+0x2c5): undefined reference to `CryptoPP::StringSinkTemplate<std::string>::StringSinkTemplate(std::string&)'
Encryptor.cpp:(.text+0x2ed): undefined reference to `CryptoPP::StreamTransformationFilter::StreamTransformationFilter(CryptoPP::StreamTransformation&, CryptoPP::BufferedTransformation*, CryptoPP::BlockPaddingSchemeDef::BlockPaddingScheme, bool)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `common::Encryptor::decrypt(std::string)':
Encryptor.cpp:(.text+0x477): undefined reference to `CryptoPP::CipherModeFinalTemplate_ExternalCipher<CryptoPP::CBC_Decryption>::CipherModeFinalTemplate_ExternalCipher(CryptoPP::BlockCipher&, unsigned char const*, int)'
Encryptor.cpp:(.text+0x4a5): undefined reference to `CryptoPP::StringSinkTemplate<std::string>::StringSinkTemplate(std::string&)'
Encryptor.cpp:(.text+0x4cd): undefined reference to `CryptoPP::StreamTransformationFilter::StreamTransformationFilter(CryptoPP::StreamTransformation&, CryptoPP::BufferedTransformation*, CryptoPP::BlockPaddingSchemeDef::BlockPaddingScheme, bool)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::SimpleKeyingInterface::~SimpleKeyingInterface()':
Encryptor.cpp:(.text._ZN8CryptoPP21SimpleKeyingInterfaceD2Ev[_ZN8CryptoPP21SimpleKeyingInterfaceD5Ev]+0x13): undefined reference to `vtable for CryptoPP::SimpleKeyingInterface'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BufferedTransformation::~BufferedTransformation()':
Encryptor.cpp:(.text._ZN8CryptoPP22BufferedTransformationD2Ev[_ZN8CryptoPP22BufferedTransformationD5Ev]+0x13): undefined reference to `vtable for CryptoPP::BufferedTransformation'
Encryptor.cpp:(.text._ZN8CryptoPP22BufferedTransformationD2Ev[_ZN8CryptoPP22BufferedTransformationD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::BufferedTransformation'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::SimpleKeyingInterface::SimpleKeyingInterface()':
Encryptor.cpp:(.text._ZN8CryptoPP21SimpleKeyingInterfaceC2Ev[_ZN8CryptoPP21SimpleKeyingInterfaceC5Ev]+0xf): undefined reference to `vtable for CryptoPP::SimpleKeyingInterface'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::StreamTransformation::~StreamTransformation()':
Encryptor.cpp:(.text._ZN8CryptoPP20StreamTransformationD2Ev[_ZN8CryptoPP20StreamTransformationD5Ev]+0x13): undefined reference to `vtable for CryptoPP::StreamTransformation'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockOrientedCipherModeBase::Resynchronize(unsigned char const*, int)':
Encryptor.cpp:(.text._ZN8CryptoPP27BlockOrientedCipherModeBase13ResynchronizeEPKhi[_ZN8CryptoPP27BlockOrientedCipherModeBase13ResynchronizeEPKhi]+0x23): undefined reference to `CryptoPP::SimpleKeyingInterface::ThrowIfInvalidIVLength(int)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Filter::~Filter()':
Encryptor.cpp:(.text._ZN8CryptoPP6FilterD2Ev[_ZN8CryptoPP6FilterD5Ev]+0x13): undefined reference to `vtable for CryptoPP::Filter'
Encryptor.cpp:(.text._ZN8CryptoPP6FilterD2Ev[_ZN8CryptoPP6FilterD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Filter'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::FilterWithBufferedInput::~FilterWithBufferedInput()':
Encryptor.cpp:(.text._ZN8CryptoPP23FilterWithBufferedInputD2Ev[_ZN8CryptoPP23FilterWithBufferedInputD5Ev]+0x13): undefined reference to `vtable for CryptoPP::FilterWithBufferedInput'
Encryptor.cpp:(.text._ZN8CryptoPP23FilterWithBufferedInputD2Ev[_ZN8CryptoPP23FilterWithBufferedInputD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::FilterWithBufferedInput'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::SecBlock<unsigned char, CryptoPP::AllocatorWithCleanup<unsigned char, false> >::~SecBlock()':
Encryptor.cpp:(.text._ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEED2Ev[_ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEED5Ev]+0x27): undefined reference to `CryptoPP::AllocatorWithCleanup<unsigned char, false>::deallocate(void*, unsigned long)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::SecBlock<unsigned char, CryptoPP::AllocatorWithCleanup<unsigned char, false> >::New(unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEE3NewEm[_ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEE3NewEm]+0x32): undefined reference to `CryptoPP::AllocatorWithCleanup<unsigned char, false>::reallocate(unsigned char*, unsigned long, unsigned long, bool)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockTransformation::BlockTransformation()':
Encryptor.cpp:(.text._ZN8CryptoPP19BlockTransformationC2Ev[_ZN8CryptoPP19BlockTransformationC5Ev]+0x19): undefined reference to `CryptoPP::Algorithm::Algorithm(bool)'
Encryptor.cpp:(.text._ZN8CryptoPP19BlockTransformationC2Ev[_ZN8CryptoPP19BlockTransformationC5Ev]+0x24): undefined reference to `vtable for CryptoPP::BlockTransformation'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockTransformation::~BlockTransformation()':
Encryptor.cpp:(.text._ZN8CryptoPP19BlockTransformationD2Ev[_ZN8CryptoPP19BlockTransformationD5Ev]+0x13): undefined reference to `vtable for CryptoPP::BlockTransformation'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Base::Base()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2Ev[_ZN8CryptoPP8Rijndael4BaseC5Ev]+0x20): undefined reference to `vtable for CryptoPP::Rijndael::Base'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael4BaseC2Ev[_ZN8CryptoPP8Rijndael4BaseC5Ev]+0x2c): undefined reference to `vtable for CryptoPP::Rijndael::Base'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Base::~Base()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael4BaseD2Ev[_ZN8CryptoPP8Rijndael4BaseD5Ev]+0x13): undefined reference to `vtable for CryptoPP::Rijndael::Base'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael4BaseD2Ev[_ZN8CryptoPP8Rijndael4BaseD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Rijndael::Base'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Enc::Enc()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2Ev[_ZN8CryptoPP8Rijndael3EncC5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2Ev[_ZN8CryptoPP8Rijndael3EncC5Ev]+0x2b): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Enc::~Enc()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3EncD2Ev[_ZN8CryptoPP8Rijndael3EncD5Ev]+0x13): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3EncD2Ev[_ZN8CryptoPP8Rijndael3EncD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc>::BlockCipherFinal(unsigned char const*, unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC5EPKhm]+0x3b): undefined reference to `CryptoPP::g_nullNameValuePairs'
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC5EPKhm]+0x4f): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockOrientedCipherModeBase::~BlockOrientedCipherModeBase()':
Encryptor.cpp:(.text._ZN8CryptoPP27BlockOrientedCipherModeBaseD2Ev[_ZN8CryptoPP27BlockOrientedCipherModeBaseD5Ev]+0x13): undefined reference to `vtable for CryptoPP::BlockOrientedCipherModeBase'
Encryptor.cpp:(.text._ZN8CryptoPP27BlockOrientedCipherModeBaseD2Ev[_ZN8CryptoPP27BlockOrientedCipherModeBaseD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::BlockOrientedCipherModeBase'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::CBC_Encryption::~CBC_Encryption()':
Encryptor.cpp:(.text._ZN8CryptoPP14CBC_EncryptionD2Ev[_ZN8CryptoPP14CBC_EncryptionD5Ev]+0x13): undefined reference to `vtable for CryptoPP::CBC_Encryption'
Encryptor.cpp:(.text._ZN8CryptoPP14CBC_EncryptionD2Ev[_ZN8CryptoPP14CBC_EncryptionD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::CBC_Encryption'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Dec::Dec()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3DecC2Ev[_ZN8CryptoPP8Rijndael3DecC5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Rijndael::Dec'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3DecC2Ev[_ZN8CryptoPP8Rijndael3DecC5Ev]+0x2b): undefined reference to `vtable for CryptoPP::Rijndael::Dec'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::Rijndael::Dec::~Dec()':
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3DecD2Ev[_ZN8CryptoPP8Rijndael3DecD5Ev]+0x13): undefined reference to `vtable for CryptoPP::Rijndael::Dec'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3DecD2Ev[_ZN8CryptoPP8Rijndael3DecD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::Rijndael::Dec'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec>::BlockCipherFinal(unsigned char const*, unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC5EPKhm]+0x3b): undefined reference to `CryptoPP::g_nullNameValuePairs'
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC5EPKhm]+0x4f): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::CBC_Decryption::~CBC_Decryption()':
Encryptor.cpp:(.text._ZN8CryptoPP14CBC_DecryptionD2Ev[_ZN8CryptoPP14CBC_DecryptionD5Ev]+0x13): undefined reference to `vtable for CryptoPP::CBC_Decryption'
Encryptor.cpp:(.text._ZN8CryptoPP14CBC_DecryptionD2Ev[_ZN8CryptoPP14CBC_DecryptionD5Ev]+0x1f): undefined reference to `vtable for CryptoPP::CBC_Decryption'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::AllocatorWithCleanup<unsigned char, true>::allocate(unsigned long, void const*)':
Encryptor.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEmPKv[_ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEmPKv]+0x40): undefined reference to `CryptoPP::AlignedAllocate(unsigned long)'
Encryptor.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEmPKv[_ZN8CryptoPP20AllocatorWithCleanupIhLb1EE8allocateEmPKv]+0x4e): undefined reference to `CryptoPP::UnalignedAllocate(unsigned long)'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::AllocatorWithCleanup<unsigned char, true>::deallocate(void*, unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvm[_ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvm]+0x39): undefined reference to `CryptoPP::AlignedDeallocate(void*)'
Encryptor.cpp:(.text._ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvm[_ZN8CryptoPP20AllocatorWithCleanupIhLb1EE10deallocateEPvm]+0x47): undefined reference to `CryptoPP::UnalignedDeallocate(void*)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x48): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x78): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&, unsigned char*)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x88): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0xa0): undefined reference to `CryptoPP::Rijndael::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0xa8): undefined reference to `CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0xf0): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x100): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x120): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0x48): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0x78): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&, unsigned char*)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0x88): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0xa0): undefined reference to `CryptoPP::Rijndael::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0xa8): undefined reference to `CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0xe8): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Dec::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0xf8): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0x118): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0x48): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0x78): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&, unsigned char*)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0x88): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0xa0): undefined reference to `CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0xa8): undefined reference to `CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0xf0): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0x100): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEE]+0x120): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0x48): undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0x78): undefined reference to `CryptoPP::SimpleKeyingInterface::GetNextIV(CryptoPP::RandomNumberGenerator&, unsigned char*)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0x88): undefined reference to `CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const*, unsigned int, CryptoPP::NameValuePairs const&)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0xa0): undefined reference to `CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0xa8): undefined reference to `CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0xe8): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const*, unsigned char const*, unsigned char*) const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0xf8): undefined reference to `CryptoPP::BlockTransformation::OptimalDataAlignment() const'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEES4_EE]+0x118): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
Encryptor.cpp:(.text._ZN8CryptoPP8Rijndael3EncC2ERKS1_[_ZN8CryptoPP8Rijndael3EncC5ERKS1_]+0x36): undefined reference to `vtable for CryptoPP::Rijndael::Enc'
collect2: error: ld returned 1 exit status
cpp/hwinfo/CMakeFiles/hwinfo.dir/build.make:85: recipe for target 'cpp/hwinfo/hwinfo' failed
make[2]: *** [cpp/hwinfo/hwinfo] Error 1
CMakeFiles/Makefile2:167: recipe for target 'cpp/hwinfo/CMakeFiles/hwinfo.dir/all' failed
make[1]: *** [cpp/hwinfo/CMakeFiles/hwinfo.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I've no idea of what is causing that.
Why is my Crypto++ library not being loaded to resolve the symbols as they are explicitly declared on my Cmake file?
EDIT: After inverting the libraries order, as follows:
target_link_libraries(hwinfo ${LIBCOMMON} ${LIBCRYPTOPP})
I'm getting fewer error messages, but still undefined symbols as follows:
[71%] Linking CXX executable hwinfo
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc>::BlockCipherFinal(unsigned char const*, unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_8Rijndael3EncEEC5EPKhm]+0x3b): undefined reference to `CryptoPP::g_nullNameValuePairs'
../../../lib/libcommon.a(Encryptor.cpp.o): In function `CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec>::BlockCipherFinal(unsigned char const*, unsigned long)':
Encryptor.cpp:(.text._ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC2EPKhm[_ZN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEC5EPKhm]+0x3b): undefined reference to `CryptoPP::g_nullNameValuePairs'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP12CBC_ModeBaseE[_ZTVN8CryptoPP12CBC_ModeBaseE]+0x128): undefined reference to `CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char*, unsigned char const*, unsigned long)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP14CipherModeBaseE[_ZTVN8CryptoPP14CipherModeBaseE]+0x100): undefined reference to `CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char*, unsigned char const*, unsigned long)'
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP15SymmetricCipherE[_ZTVN8CryptoPP15SymmetricCipherE]+0xe8): undefined reference to `CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char*, unsigned char const*, unsigned long)'
collect2: error: ld returned 1 exit status
cpp/hwinfo/CMakeFiles/hwinfo.dir/build.make:85: recipe for target 'cpp/hwinfo/hwinfo' failed
make[2]: *** [cpp/hwinfo/hwinfo] Error 1
CMakeFiles/Makefile2:167: recipe for target 'cpp/hwinfo/CMakeFiles/hwinfo.dir/all' failed
make[1]: *** [cpp/hwinfo/CMakeFiles/hwinfo.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Order matters! If library A depends on library B, then library A must come before library B when linking. So the simple solution is to change the order in which you link your "common" library and the cryptopp library.
Also note that since you apparently create a static library, you don't actually link anything when creating the library. So the target_link_libraries command is useless for the library, as your project is currently set up.
My suggestion is that you link the two CMakeLists.txt files together, so the main executable CMakeLists.txt file uses the library CMakeLists.txt file (for example using the add_subdirectory command). Then you first of all don't need to install the library, and you could make COMMON depend on CRYPTOPP and CMake would link in correct order.
Based on this:
I have a project that depends on cryptopp on Debian 8.10
And this:
../../../lib/libcommon.a(Encryptor.cpp.o):(.rodata._ZTVN8CryptoPP15SymmetricCipherE[_ZTVN8CryptoPP15SymmetricCipherE]+0xe8):
undefined reference to `CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char*, unsigned char const*, unsigned long)'
collect2: error: ld returned 1 exit status
And this:
-- CRYPTO LIBRARY ===>/usr/local/lib/libcryptopp.a
It looks like you have two copies of the Crypo++ library and you are mixing and matching them.
I think the easiest/best fix is to run the following commands. They remove your copy so you use Debian's copy.
rm -rf /usr/local/include/cryptopp
rm -rf /usr/local/lib/*cryptopp*
rm -rf /usr/local/bin/cryptest*
rm -rf /usr/local/share/cryptopp
The reason I think its a problem is because ProcessLastBlock now returns a size_t. That change happened at Crypto++ 6.0. The change was needed for authenticated encryption modes like OCB. OCB handles padding of the last block itself, so it needed a way to specify how much of the provided buffer was used.
Crypto++ 5.6.3 and earlier used ProcessLastBlock that returned void. There was a tight coupling of a block cipher mode and an explicit requirement the last block was always a full block size. But like I said, that did not hold as we started adding additional modes of operation.
Also see the head notes in filters.cpp and the function StreamTransformationFilter::LastPut:
// This block is new to StreamTransformationFilter. It somewhat of a hack and was added
// for OCB mode; see GitHub Issue 515. The rub with OCB is, its a block cipher and the
// last block size can be 0. However, "last block = 0" is not the 0 predacted in the
// original code. In the orginal code 0 means "nothing special" so DEFAULT_PADDING is
// applied. OCB's 0 literally means a final block size can be 0 or non-0; and no padding
// is needed in either case because OCB has its own scheme (see handling of P_* and A_*).
// Stream ciphers have policy objects to convey how to operate the cipher. The Crypto++
// framework operates well when MinLastBlockSize() is 1. However, it did not appear to
// cover the OCB case either because we can't stream OCB. It needs full block sizes. In
// response we hacked a IsLastBlockSpecial(). When true StreamTransformationFilter
// defers to the mode for processing of the last block.
// The behavior supplied when IsLastBlockSpecial() will likely have to evolve to capture
// more complex cases from different authenc modes. I suspect it will have to change
// from a simple bool to something that conveys more information, like "last block
// no padding" or "custom padding applied by cipher".
// In some respect we have already hit the need for more information. For example, OCB
// calculates the checksum on the cipher text at the same time, so we don't need the
// disjoint behavior of calling "EncryptBlock" followed by a separate "AuthenticateBlock".
// Additional information may allow us to avoid the two spearate calls.
And to reiterate from Linux | Distribution Package on the wiki:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.10 (jessie)
Release: 8.10
Codename: jessie
$ apt-cache search libcrypto++
...
libcrypto++-dev - General purpose cryptographic library - C++ development
libcrypto++-doc - General purpose cryptographic library - documentation
libcrypto++-utils - General purpose cryptographic library - utilities and data files
libcrypto++9 - General purpose cryptographic library - shared library
libcrypto++9-dbg - General purpose cryptographic library - debug symbols
So you need libcrypto++9, libcrypto++-dev and possibly libcrypto++9-dbg.
I tried to use Jellyfish, a bioinformatics software. Everything went well in [make] and [make install]. The executable bin file also works. What I want is to compile my own code against the Jellyfish include files and the shared libraries.
I tried to compile the following simple code, which is very simple, with only one declaration of hash_counter.
#include <iostream>
#include <jellyfish/mer_dna.hpp>
#include <jellyfish/hash_counter.hpp>
typedef jellyfish::cooperative::hash_counter<jellyfish::mer_dna> mer_hash_type;
int main(int argc, char *argv[]) {
jellyfish::mer_dna::k(25); // Set length of mers (k=25)
const uint64_t hash_size = 10000000; // Initial size of hash.
const uint32_t num_reprobes = 126;
const uint32_t num_threads = 16; // Number of concurrent threads
const uint32_t counter_len = 7; // Minimum length of counting field
const bool canonical = true; // Use canonical representation
// create the hash
mer_hash_type mer_hash(hash_size, jellyfish::mer_dna::k()*2, counter_len, num_threads, num_reprobes);
return 0;
}
This code can be successfully compiled on Mac using the command below
$g++ -std=c++11 -I/home/jellyfish_lib/include/jellyfish-2.2.5 -L/home/jellyfish_lib/lib -lpthread -ljellyfish-2.0 test.c -o test
but failed when compiled on Ubuntu (with g++ 4.9), with the following error,
/tmp/ccKzjmVq.o: In function `main':
test.c:(.text+0x56): undefined reference to `jellyfish::quadratic_reprobes'
/tmp/ccKzjmVq.o: In function `jellyfish::random_bits()':
test.c:(.text._ZN9jellyfish11random_bitsEv[_ZN9jellyfish11random_bitsEv]+0xa): undefined reference to `jellyfish::random_bits(int)'
/tmp/ccKzjmVq.o: In function `allocators::mmap::~mmap()':
test.c:(.text._ZN10allocators4mmapD2Ev[_ZN10allocators4mmapD5Ev]+0x14): undefined reference to `allocators::mmap::free()'
/tmp/ccKzjmVq.o: In function `jellyfish::RectangularBinaryMatrix::RectangularBinaryMatrix(unsigned int, unsigned int)':
test.c:(.text._ZN9jellyfish23RectangularBinaryMatrixC2Ejj[_ZN9jellyfish23RectangularBinaryMatrixC5Ejj]+0x1d): undefined reference to `jellyfish::RectangularBinaryMatrix::alloc(unsigned int, unsigned int)'
/tmp/ccKzjmVq.o: In function `jellyfish::RectangularBinaryMatrix::RectangularBinaryMatrix(jellyfish::RectangularBinaryMatrix const&)':
test.c:(.text._ZN9jellyfish23RectangularBinaryMatrixC2ERKS0_[_ZN9jellyfish23RectangularBinaryMatrixC5ERKS0_]+0x23): undefined reference to `jellyfish::RectangularBinaryMatrix::alloc(unsigned int, unsigned int)'
/tmp/ccKzjmVq.o: In function `jellyfish::RectangularBinaryMatrix::randomize_pseudo_inverse()':
test.c:(.text._ZN9jellyfish23RectangularBinaryMatrix24randomize_pseudo_inverseEv[_ZN9jellyfish23RectangularBinaryMatrix24randomize_pseudo_inverseEv]+0x24): undefined reference to `jellyfish::RectangularBinaryMatrix::randomize_pseudo_inverse(unsigned long (*)())'
/tmp/ccKzjmVq.o: In function `jellyfish::locks::pthread::barrier::barrier(unsigned int)':
test.c:(.text._ZN9jellyfish5locks7pthread7barrierC2Ej[_ZN9jellyfish5locks7pthread7barrierC5Ej]+0x1f): undefined reference to `pthread_barrier_init'
/tmp/ccKzjmVq.o: In function `jellyfish::locks::pthread::barrier::~barrier()':
test.c:(.text._ZN9jellyfish5locks7pthread7barrierD2Ev[_ZN9jellyfish5locks7pthread7barrierD5Ev]+0x14): undefined reference to `pthread_barrier_destroy'
/tmp/ccKzjmVq.o: In function `jellyfish::large_hash::array_base<jellyfish::mer_dna_ns::mer_base_static<unsigned long, 0>, unsigned long, atomic::gcc, jellyfish::large_hash::array<jellyfish::mer_dna_ns::mer_base_static<unsigned long, 0>, unsigned long, atomic::gcc, allocators::mmap> >::array_base(unsigned long, unsigned short, unsigned short, unsigned short, jellyfish::RectangularBinaryMatrix, unsigned long const*)':
test.c:(.text._ZN9jellyfish10large_hash10array_baseINS_10mer_dna_ns15mer_base_staticImLi0EEEmN6atomic3gccENS0_5arrayIS4_mS6_N10allocators4mmapEEEEC2EmtttNS_23RectangularBinaryMatrixEPKm[_ZN9jellyfish10large_hash10array_baseINS_10mer_dna_ns15mer_base_staticImLi0EEEmN6atomic3gccENS0_5arrayIS4_mS6_N10allocators4mmapEEEEC5EmtttNS_23RectangularBinaryMatrixEPKm]+0x269): undefined reference to `jellyfish::RectangularBinaryMatrix::pseudo_inverse() const'
/tmp/ccKzjmVq.o: In function `jellyfish::large_hash::array<jellyfish::mer_dna_ns::mer_base_static<unsigned long, 0>, unsigned long, atomic::gcc, allocators::mmap>::alloc_data(unsigned long)':
test.c:(.text._ZN9jellyfish10large_hash5arrayINS_10mer_dna_ns15mer_base_staticImLi0EEEmN6atomic3gccEN10allocators4mmapEE10alloc_dataEm[_ZN9jellyfish10large_hash5arrayINS_10mer_dna_ns15mer_base_staticImLi0EEEmN6atomic3gccEN10allocators4mmapEE10alloc_dataEm]+0x1f): undefined reference to `allocators::mmap::realloc(unsigned long)'
collect2: error: ld returned 1 exit status
It seems something went wrong during linking. Does anyone have experience about this?
I have some problem with compile correct application in fresh-installed Clion IDE. Earlier I used Code::Blocks and all compiling successfully. Project use pthread and Crypto++ library. I'm already have them installed on my Ubuntu 15.04. And compile Clion project with -pthread flag. But it can't find crypto++ library. How to fix this?
My CMake file:
cmake_minimum_required(VERSION 3.3)
project(Chat)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
set(SOURCE_FILES
include/Chat.h
include/Checker.h
include/Client.h
include/DataTransferingInterface.h
include/EncryptorDES.h
include/EncryptorRSA.h
include/Logger.h
include/OwnerClientInterface.h
include/OwnerServerInterface.h
include/Parser.h
include/SecureChat.h
include/Server.h
src/Chat.cpp
src/Checker.cpp
src/Client.cpp
src/DataTransferingInterface.cpp
src/EncryptorDES.cpp
src/EncryptorRSA.cpp
src/Logger.cpp
src/OwnerClientInterface.cpp
src/OwnerServerInterface.cpp
src/Parser.cpp
src/SecureChat.cpp
src/Server.cpp
main.cpp)
add_executable(Chat ${SOURCE_FILES})
Compile errors:
/usr/include/cryptopp/integer.h:26: undefined reference to `vtable for CryptoPP::Integer'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT::~MultiplicativeGroupT()':
/usr/include/cryptopp/algebra.h:70: undefined reference to `vtable for CryptoPP::AbstractRing<CryptoPP::Integer>::MultiplicativeGroupT'
/usr/include/cryptopp/algebra.h:70: undefined reference to `CryptoPP::AbstractGroup<CryptoPP::Integer>::~AbstractGroup()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileStore::~FileStore()':
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
/usr/include/cryptopp/files.h:14: undefined reference to `vtable for CryptoPP::FileStore'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::FileSink::~FileSink()':
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
/usr/include/cryptopp/files.h:77: undefined reference to `vtable for CryptoPP::FileSink'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC_Base::~HMAC_Base()':
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
/usr/include/cryptopp/hmac.h:12: undefined reference to `vtable for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::AlgorithmParametersTemplate<char const*>::AssignValue(char const*, std::type_info const&, void*) const':
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
/usr/include/cryptopp/algparam.h:313: undefined reference to `CryptoPP::g_pAssignIntToInteger'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/integer.h:118: undefined reference to `CryptoPP::Integer::Zero()'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptorBase<CryptoPP::ECPPoint>::Encrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::One()'
/usr/include/cryptopp/pubkey.h:1228: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::RandomNumberGenerator&, CryptoPP::Integer const&, CryptoPP::Integer const&, CryptoPP::Integer::RandomNumberType, CryptoPP::Integer const&, CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::Pump2(unsigned long long&, bool)':
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:763: undefined reference to `CryptoPP::FileStore::TransferTo2(CryptoPP::BufferedTransformation&, unsigned long long&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpMessages2(unsigned int&, bool)':
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:765: undefined reference to `CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::BufferedTransformation&, unsigned int&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::PumpAll2(bool)':
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::DEFAULT_CHANNEL'
/usr/include/cryptopp/filters.h:767: undefined reference to `CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTransformation&, std::string const&, bool)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::SourceTemplate<CryptoPP::FileStore>::SourceExhausted() const':
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyRetrievable() const'
/usr/include/cryptopp/filters.h:769: undefined reference to `CryptoPP::BufferedTransformation::AnyMessages() const'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricEncrypt(CryptoPP::RandomNumberGenerator&, unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:439: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:441: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:442: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_EncryptionAlgorithm_Xor<CryptoPP::HMAC<CryptoPP::SHA1>, false>::SymmetricDecrypt(unsigned char const*, unsigned char const*, unsigned long, unsigned char*, CryptoPP::NameValuePairs const&) const':
/usr/include/cryptopp/gfpcrypt.h:470: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:471: undefined reference to `CryptoPP::HMAC_Base::Update(unsigned char const*, unsigned long)'
/usr/include/cryptopp/gfpcrypt.h:481: undefined reference to `CryptoPP::xorbuf(unsigned char*, unsigned char const*, unsigned char const*, unsigned long)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithEphemeralPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::DL_FixedBasePrecomputation<CryptoPP::ECPPoint> const&, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1445: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::DL_KeyAgreementAlgorithm_DH<CryptoPP::ECPPoint, CryptoPP::EnumToType<CryptoPP::CofactorMultiplicationOption, 0> >::AgreeWithStaticPrivateKey(CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint> const&, CryptoPP::ECPPoint const&, bool, CryptoPP::Integer const&) const':
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
/usr/include/cryptopp/pubkey.h:1473: undefined reference to `CryptoPP::Integer::Integer(CryptoPP::Integer const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HMAC<CryptoPP::SHA1>::HMAC(unsigned char const*, unsigned long)':
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::g_nullNameValuePairs'
/usr/include/cryptopp/hmac.h:48: undefined reference to `CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const*, unsigned long, CryptoPP::NameValuePairs const&)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::P1363_KDF2<CryptoPP::SHA1>::DeriveKey(unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long)':
/usr/include/cryptopp/pubkey.h:506: undefined reference to `CryptoPP::P1363_MGF1KDF2_Common(CryptoPP::HashTransformation&, unsigned char*, unsigned long, unsigned char const*, unsigned long, unsigned char const*, unsigned long, bool, unsigned int)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::Init()':
/usr/include/cryptopp/iterhash.h:90: undefined reference to `CryptoPP::SHA1::InitState(unsigned int*)'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE[_ZTIN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o:(.rodata._ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE[_ZTIN8CryptoPP25SimpleKeyingInterfaceImplINS_9HMAC_BaseENS_4HMACINS_4SHA1EEEEE]+0x10): undefined reference to `typeinfo for CryptoPP::HMAC_Base'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::HashTransformation::HashTransformation(CryptoPP::HashTransformation const&)':
/usr/include/cryptopp/cryptlib.h:531: undefined reference to `vtable for CryptoPP::HashTransformation'
CMakeFiles/Chat.dir/src/EncryptorRSA.cpp.o: In function `CryptoPP::IteratedHashWithStaticTransform<unsigned int, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, 20u, CryptoPP::SHA1, 0u, false>::HashEndianCorrectedBlock(unsigned int const*)':
/usr/include/cryptopp/iterhash.h:89: undefined reference to `CryptoPP::SHA1::Transform(unsigned int*, unsigned int const*)'
collect2: error: ld returned 1 exit status
CMakeFiles/Chat.dir/build.make:406: recipe for target 'Chat' failed
make[2]: *** [Chat] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Chat.dir/all' failed
make[1]: *** [CMakeFiles/Chat.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I performed the following after add_executable in my CMakeLists.txt to resolve the issue:
target_link_libraries(Chat /usr/lib/libcrypto++.a)
Here I have read good references about FANN for Artificial Neural Networks in C/C++.
Actually I am using C++ (on Ubuntu with g++ v4.6.1). The library written in C, has a wrapper for C++. But I don't get it to work. Even the example included xor_sample.cpp works.
I have a Makefile with a line like this:
xor_sample:
g++ -I $(FANNINCLUDE) xor_sample.cpp -o xor_sample
Being FANNINCLUDE the path to FANN/src/include, where the headers are (floatfan.h and fann_cpp.h).
Has somebody actually compiled it for C++? What I am doing wrong?
My intention is to use the headers files (NOT installing the library and linking with -lfann). Is this possible?
EDIT: I get this errors
/tmp/ccIpH6p4.o: In function `FANN::training_data::destroy_train()':
xor_sample.cpp:(.text._ZN4FANN13training_data13destroy_trainEv[FANN::training_data::destroy_train()]+0x18): undefined reference to `fann_destroy_train'
/tmp/ccIpH6p4.o: In function `FANN::training_data::read_train_from_file(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
xor_sample.cpp:(.text._ZN4FANN13training_data20read_train_from_fileERKSs[FANN::training_data::read_train_from_file(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x20): undefined reference to `fann_read_train_from_file'
/tmp/ccIpH6p4.o: In function `FANN::training_data::save_train_to_fixed(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)':
xor_sample.cpp:(.text._ZN4FANN13training_data19save_train_to_fixedERKSsj[FANN::training_data::save_train_to_fixed(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)]+0x37): undefined reference to `fann_save_train_to_fixed'
/tmp/ccIpH6p4.o: In function `FANN::training_data::length_train_data()':
xor_sample.cpp:(.text._ZN4FANN13training_data17length_train_dataEv[FANN::training_data::length_train_data()]+0x1f): undefined reference to `fann_length_train_data'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::destroy()':
xor_sample.cpp:(.text._ZN4FANN10neural_net7destroyEv[FANN::neural_net::destroy()]+0x18): undefined reference to `fann_get_user_data'
xor_sample.cpp:(.text._ZN4FANN10neural_net7destroyEv[FANN::neural_net::destroy()]+0x39): undefined reference to `fann_destroy'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::create_standard_array(unsigned int, unsigned int const*)':
xor_sample.cpp:(.text._ZN4FANN10neural_net21create_standard_arrayEjPKj[FANN::neural_net::create_standard_array(unsigned int, unsigned int const*)]+0x1f): undefined reference to `fann_create_standard_array'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::run(float*)':
xor_sample.cpp:(.text._ZN4FANN10neural_net3runEPf[FANN::neural_net::run(float*)]+0x26): undefined reference to `fann_run'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::init_weights(FANN::training_data const&)':
xor_sample.cpp:(.text._ZN4FANN10neural_net12init_weightsERKNS_13training_dataE[FANN::neural_net::init_weights(FANN::training_data const&)]+0x2a): undefined reference to `fann_init_weights'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::save(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
xor_sample.cpp:(.text._ZN4FANN10neural_net4saveERKSs[FANN::neural_net::save(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x30): undefined reference to `fann_save'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::save_to_fixed(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
xor_sample.cpp:(.text._ZN4FANN10neural_net13save_to_fixedERKSs[FANN::neural_net::save_to_fixed(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x30): undefined reference to `fann_save_to_fixed'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::train_on_data(FANN::training_data const&, unsigned int, unsigned int, float)':
xor_sample.cpp:(.text._ZN4FANN10neural_net13train_on_dataERKNS_13training_dataEjjf[FANN::neural_net::train_on_data(FANN::training_data const&, unsigned int, unsigned int, float)]+0x3f): undefined reference to `fann_train_on_data'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::get_MSE()':
xor_sample.cpp:(.text._ZN4FANN10neural_net7get_MSEEv[FANN::neural_net::get_MSE()]+0x20): undefined reference to `fann_get_MSE'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_callback(int (*)(FANN::neural_net&, FANN::training_data&, unsigned int, unsigned int, float, unsigned int, void*), void*)':
xor_sample.cpp:(.text._ZN4FANN10neural_net12set_callbackEPFiRS0_RNS_13training_dataEjjfjPvES4_[FANN::neural_net::set_callback(int (*)(FANN::neural_net&, FANN::training_data&, unsigned int, unsigned int, float, unsigned int, void*), void*)]+0x1c): undefined reference to `fann_get_user_data'
xor_sample.cpp:(.text._ZN4FANN10neural_net12set_callbackEPFiRS0_RNS_13training_dataEjjfjPvES4_[FANN::neural_net::set_callback(int (*)(FANN::neural_net&, FANN::training_data&, unsigned int, unsigned int, float, unsigned int, void*), void*)]+0x81): undefined reference to `fann_set_user_data'
xor_sample.cpp:(.text._ZN4FANN10neural_net12set_callbackEPFiRS0_RNS_13training_dataEjjfjPvES4_[FANN::neural_net::set_callback(int (*)(FANN::neural_net&, FANN::training_data&, unsigned int, unsigned int, float, unsigned int, void*), void*)]+0x9c): undefined reference to `fann_set_callback'
xor_sample.cpp:(.text._ZN4FANN10neural_net12set_callbackEPFiRS0_RNS_13training_dataEjjfjPvES4_[FANN::neural_net::set_callback(int (*)(FANN::neural_net&, FANN::training_data&, unsigned int, unsigned int, float, unsigned int, void*), void*)]+0xb3): undefined reference to `fann_set_callback'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::print_parameters()':
xor_sample.cpp:(.text._ZN4FANN10neural_net16print_parametersEv[FANN::neural_net::print_parameters()]+0x18): undefined reference to `fann_print_parameters'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_learning_rate(float)':
xor_sample.cpp:(.text._ZN4FANN10neural_net17set_learning_rateEf[FANN::neural_net::set_learning_rate(float)]+0x1f): undefined reference to `fann_set_learning_rate'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_activation_function_hidden(FANN::activation_function_enum)':
xor_sample.cpp:(.text._ZN4FANN10neural_net30set_activation_function_hiddenENS_24activation_function_enumE[FANN::neural_net::set_activation_function_hidden(FANN::activation_function_enum)]+0x1f): undefined reference to `fann_set_activation_function_hidden'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_activation_function_output(FANN::activation_function_enum)':
xor_sample.cpp:(.text._ZN4FANN10neural_net30set_activation_function_outputENS_24activation_function_enumE[FANN::neural_net::set_activation_function_output(FANN::activation_function_enum)]+0x1f): undefined reference to `fann_set_activation_function_output'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_activation_steepness_hidden(float)':
xor_sample.cpp:(.text._ZN4FANN10neural_net31set_activation_steepness_hiddenEf[FANN::neural_net::set_activation_steepness_hidden(float)]+0x1f): undefined reference to `fann_set_activation_steepness_hidden'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::set_activation_steepness_output(float)':
xor_sample.cpp:(.text._ZN4FANN10neural_net31set_activation_steepness_outputEf[FANN::neural_net::set_activation_steepness_output(float)]+0x1f): undefined reference to `fann_set_activation_steepness_output'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::get_network_type()':
xor_sample.cpp:(.text._ZN4FANN10neural_net16get_network_typeEv[FANN::neural_net::get_network_type()]+0x1f): undefined reference to `fann_get_network_type'
/tmp/ccIpH6p4.o: In function `FANN::neural_net::internal_callback(fann*, fann_train_data*, unsigned int, unsigned int, float, unsigned int)':
xor_sample.cpp:(.text._ZN4FANN10neural_net17internal_callbackEP4fannP15fann_train_datajjfj[FANN::neural_net::internal_callback(fann*, fann_train_data*, unsigned int, unsigned int, float, unsigned int)]+0xe): undefined reference to `fann_get_user_data'
collect2: ld returned 1 exit status
make: *** [xor_sample] Error 1
if you just need them installed, they are already on ubuntu repository
sudo apt-get install libfann1 libfann1-dev
if you still want to install it from source, there's a guide on their page
http://leenissen.dk/fann/wp/help/installing-fann/
if this doesn't bring you further, try installing to other location using:
cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr .
Hope this helps
You should still be able to compile it without installing FANN by correcting your makefile
g++ -I $(FANNINCLUDE) xor_sample.cpp -o xor_sample -L $(FANNLIBS) -lfann
Of course you will still need to have compiled LibFANN, and "FANNLIBS" will have to be the directory of the compiled libraries of libfann.