LD: undefined reference to... when linking against lib

Hi All,

I’m trying to work through a ‘Hello World’ equivalent in Crypto++. The Crypto++ library (libcryptopp.a) is located at /usr/lib.

g++ -L/usr/lib -lcryptopp -o test test.cpp

/tmp/ccjWpXG2.o: In function main’:test.cpp: (.text+0x34):
undefined reference to CryptoPP::RandomNumberGenerator::GenerateBlock(unsigned char*, unsigned int)’

/tmp/ccMkjBNT.o: In function CryptoPP::RandomNumberGenerator::RandomNumberGenerator()': test.cpp: (.text._ZN8CryptoPP21RandomNumberGeneratorC1Ev[CryptoPP::RandomNumberGenerator::RandomNumberGenerator()]+0x15): undefined reference to CryptoPP::Algorithm::Algorithm(bool)’

cat /usr/lib/libcryptopp.a | grep -a CryptoPP::RandomNumberGenerator::GenerateBlock does regurgitate to the screen, so I believe the function is part of the library.

Any ideas on what I am doing wrong? And what is the tool of choice to browse a library for function? I imagine cat is less than desired.

Thanks,
Jeff

> g++ -L/usr/lib -lcryptopp -o test test.cpp
Order matters (I don’t recall this being a problem in the past):
g++ -o test test.cpp -lcryptopp

> cat /usr/lib/libcryptopp.a | grep -a CryptoPP::RandomNumberGenerator::GenerateBlock
> And what is the tool of choice to browse a library for function?
nm

Jeff