Hi, As you've no doubt guessed, these questions are not specific to crypto++. Either a gcc users' forum or a linux developers' forum is likely to be more fruitful for quick, correct answers to this sort of thing :-).
> In order to compile a .cpp source code file using the cryptopp library > can it be done by just using one gcc on the command line or does a > makefile need to be used? The only #includes I am using are hmac.h and > sha.h. There's nothing special about the cryptopp library in that regard. It's just a standard static library and all the rules for using those apply. For an authoritative explanation of those, nose around here: http://gcc.gnu.org/onlinedocs/gcc-4.2.3/gcc/Link-Options.html In a nutshell, though, there are two ways to get gcc to link to a static library here. You could: - use the "-L" switch to add the directory containing libcryptopp.a to your library search path then use the "-l" switch to instruct gcc to tell the linker to process libcryptopp.a. Pay attention to the documentation linked above on this... if you're using the "-l" switch, omit "lib" and ".a" from the library name, like so: g++ -o yourprogram -I$CRYPTOPP_INCLUDE_LOCATION yoursource.cc -L$CRYPTOPP_LIBRARY_LOCATION -lcryptopp You could also: - give g++ the exact path to the archive, like so g++ -o yourprogram -I$CRYPTOPP_INCLUDE_LOCATION yoursource.cc $CRYPTOPP_LIBRARY_LOCATION/libcryptopp.a The two are equivalent. Pay attention to the ordering requirements described in the gcc manual. > I get this one huge error message and this is the end of the error > message: > > nt, CryptoPP::HashTransformation>::TruncatedFinal(unsigned char*, > unsigned int)' > /tmp/ccplhGBR.o: > (.rodata._ZTVN8CryptoPP12IteratedHashIjNS_10EnumToTypeINS_9ByteOrderELi1EEELj64ENS_18HashTransformationEEE[vtable > for CryptoPP::IteratedHash<unsigned int, > CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 64u, > CryptoPP::HashTransformation>]+0x4c): undefined reference to > `CryptoPP::HashTransformation::TruncatedVerify(unsigned char const*, > unsigned int)' (snip) Those are definitely linker errors; you haven't told the linker where those symbols are defined. If you correctly specify the library (assuming it built properly in the first place) as described, either way, above this should go away along with your follow-on questions. HTH, Geoff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [EMAIL PROTECTED] More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
