私は自分のシステムに静的にcryptoppをビルドしました。すべてのテストにも合格しています。これらは警告している私がテストQTプロジェクトでCrypto ++静的ライブラリを使用する
WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.
WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.
WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.
WARNING: You should make these changes in config.h, and not CXXFLAGS.
WARNING: You can 'mv config.recommend config.h', but it breaks versioning.
WARNING: See http://cryptopp.com/wiki/config.h for more details.
中に取得するのに私は今
TEMPLATE = app
LIBS += -L/usr/lib/libcryptopp.a
#LIBS += -lcryptopp
CONFIG += console c++11
CONFIG += staticlib
SOURCES += main.cpp \
hashdata.cpp
HEADERS += \
hashdata.hpp
としての私のQTプロジェクトファイルでこれをリンクしかし、私はこれをコンパイルするとき、私はすべての未定義エラーが発生します。
hashdata.o: In function `hashdata::hashfunction(std::string)':
hashdata.cpp:(.text+0x1fb): undefined reference to `CryptoPP::Algorithm::Algorithm(bool)'
hashdata.cpp:(.text+0x270): undefined reference to `CryptoPP::SHA512::InitState(unsigned long long*)'
hashdata.cpp:(.text+0x29a): undefined reference to `CryptoPP::Algorithm::Algorithm(bool)'
hashdata.cpp:(.text+0x2a1): undefined reference to `vtable for CryptoPP::StringSinkTemplate<std::string>'
hashdata.cpp:(.text+0x30b): undefined reference to `CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*)'
hashdata.cpp:(.text+0x312): undefined reference to `vtable for CryptoPP::Grouper'
hashdata.cpp:(.text+0x35e): undefined reference to `CryptoPP::Filter::Detach(CryptoPP::BufferedTransformation*)'
hashdata.cpp:(.text+0x375): undefined reference to `CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*)'
hashdata.cpp:(.text+0x37c): undefined reference to `vtable for CryptoPP::BaseN_Encoder'
hashdata.cpp:(.text+0x3d3): undefined reference to `CryptoPP::Filter::Detach(CryptoPP::BufferedTransformation*)'
hashdata.cpp:(.text+0x3e5): undefined reference to `CryptoPP::ProxyFilter::ProxyFilter(CryptoPP::BufferedTransformation*, unsigned long, unsigned long, CryptoPP::BufferedTransformation*)'
hashdata.cpp:(.text+0x3ec): undefined reference to `vtable for CryptoPP::HexEncoder'
hashdata.cpp:(.text+0x452): undefined reference to `vtable for CryptoPP::AlgorithmParametersTemplate<int>'
hashdata.cpp:(.text+0x4af): undefined reference to `vtable for CryptoPP::AlgorithmParametersTemplate<CryptoPP::ConstByteArrayParameter>'
...
私はgoogleで検索したときにこれまで同様の問題が発生していましたが、解決策は不明です。 C++ 11のフラグが原因である可能性がありますか?
Crypto ++には、プロジェクトに含めるヘッダーがいくつかあります。あなたのプロジェクトファイルに 'HEADERS + = path/to/cryptopps/headers/you/are/using.hpp'のようなものを追加してください。 – ForceBru
私のhashdata.hppに '' cryptopp/filters.h "'があり、QTはファイルが見つからないと言っていません。 'HEADER + ='に追加すると、これらのファイルがプロジェクトにコピーされます。しかし、とにかく試してみる。 – itsnevertoobadtoaskforhelp
生成されるコマンドラインはありますか? –