I've been racking my brains out for a few hours trying to get Crypto++ 5.1 to 
compile fully on Debian unstable and have hit the perverbial wall. (Well, 
technically it does compile, it just doesn't link.)

Here's a sample of the output from the test program build:

g++ -o cryptest.exe -O0 -DNDEBUG -ffunction-sections -fdata-sections -msse2 
-pipe bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o 
datatest.o regtest.o fipsalgt.o dlltest.o -L. -lcryptopp -Wl,--gc-sections
test.o(.bss._ZGVZNK8CryptoPP9SingletonINS_4OAEPINS_3SHAENS_10P1363_MGF1EEENS_9NewObjectIS4_EELi0EE3RefEzE9s_pObject+0x0):
 
multiple definition of `guard variable for 
CryptoPP::Singleton<CryptoPP::OAEP<CryptoPP::SHA, CryptoPP::P1363_MGF1>, 
CryptoPP::NewObject<CryptoPP::OAEP<CryptoPP::SHA, CryptoPP::P1363_MGF1> >, 
(int)0>::Ref(...)::s_pObject const' 
nch2.o(.bss._ZGVZNK8CryptoPP9SingletonINS_4OAEPINS_3SHAENS_10P1363_MGF1EEENS_9NewObjectIS4_EELi0EE3RefEzE9s_pObject+0x0):
first defined here

<snip similar messages>

collect2: ld returned 1 exit status
make: *** [cryptest.exe] Error 1


The libcryptopp.a library itself builds fine, but I can't get anything to link 
to it, including the test program. I also have a PHP extension that wraps 
much of Crypto++'s symetric cipher and hash algorithms, which dies similarly.

I've tried checking out the latest code from CVS, same problem. I've taken a 
look at some of 

Has anybody else hit this problem?

A few details if it will help:

- OS: Debian GNU/Linux 3.0 r1 Woody, installed from official CDs then 
dist-upgraded to unstable

- gcc version: 3.3.3 20040125 (prerelease) (Debian)

- flags from the makefile: 

CXXFLAGS = -O0 -DNDEBUG -ffunction-sections -fdata-sections
LDFLAGS = -Wl,--gc-sections
ARFLAGS = -cr


It's quite possible that I'm simply doing something stupid, as I rarely use 
Debian. (Crypto++ works fine for me on Solaris, Red Hat, Gentoo and Windows, 
so I'm hoping that the problem here isn't the user, although it wouldn't 
surprise me.)

If anybody would like more information, I'll see what I can provide. Any 
advice would be appreciated. 

J

Reply via email to