I am unable to link the cryptopp.dll on Windows XP Pro using cygwin and
gcc. I followed the steps below and hacked my through 80% of the build.
I am stuck on the cryptest.import.exe target.

Downloaded Cygwin with all packages except for the desktop, game,
multimedia, and graphic packages.

-----------------
$ g++ -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with:
/usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --verbose
--prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry
--enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
-----------------

Downloaded Crypto++ v5.4 ZIP file.

Run CygWin Shell (C:\cygwin\cygwin.bat).

Unzipped cryptopp54.zip using cygwin's unzip -a into
~/Docs/Projects/Crypto++/dev/src folder.

(make complained about being unable to build the modexppc.h output.)
Created "empty" C++ file for modexppc.cpp using example on the web.
        -------------------------------------------
        #include "pch.h"

        #ifndef CRYPTOPP_IMPORTS

        #include "modexppc.h"
        #include "asn.h"

        NAMESPACE_BEGIN(CryptoPP)

        NAMESPACE_END

        #endif
        -------------------------------------------

(Many comments on the web suggested trying to build in release mode.)
Changed GNUmakefile as follows
        Uncommented lines:
                CXXFLAGS = -O3 -DNDEBUG -ffunction-sections -fdata-sections
                LDFLAGS += -Wl,--gc-sections

(The other targets were unable to link in the pssr and emsa2 objects.)
        Changed line
                DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp 
cbcmac.cpp
channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp
ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp
fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp
integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp
nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp
queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp
sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp

                to include pssr.cpp and emsa2.cpp:

                DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp 
cbcmac.cpp
channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp
ec2n.cpp eccrypto.cpp ecp.cpp emsa2.cpp eprecomp.cpp files.cpp
filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp
hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp
mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pssr.cpp
pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp
rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp

(I saw some updates in the CVS repository.)
        Loaded CVS repository and copied file changes into the src folder.
(20061225 files)

(I'm runing cygwin.)
rm *.vcproj
rm *.bdsproj *.bdsgroup

I am able to make the cryptest.exe target by running make without any
parameters. I am also able to run the "./cryptest v" test and it
passes. When I try to create the cryptopp.dll it fails to link. It
fails when making the cryptest.import.exe target. I use the make
command:

$ make clean dll

I am getting over 4000 "undefined reference to" errors. The first dozen
errors look like:

-----------------
bench.import.o:bench.cpp:(.text+0x2ef): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char>::allocate(unsigned int,
void const*)'
bench.import.o:bench.cpp:(.text+0x4f4): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char>::allocate(unsigned int,
void const*)'
bench.import.o:bench.cpp:(.text+0x6df): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char>::allocate(unsigned int,
void const*)'
bench.import.o:bench.cpp:(.text+0x892): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char>::allocate(unsigned int,
void const*)'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x18): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::Update(unsigned char const*, unsigned
int)'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x1c): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::CreateUpdateSpace(unsigned int&)'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x24): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::Restart()'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x2c): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::BlockSize() const'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x30): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::OptimalBlockSize() const'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x34): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::OptimalDataAlignment() const'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x44): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::TruncatedFinal(unsigned char*, unsigned
int)'
bench.import.o:bench.cpp:(.rdata$_ZTVN8CryptoPP3MD5E[vtable for
CryptoPP::MD5]+0x60): undefined reference to
`CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::HashMultipleBlocks(unsigned int const*,
unsigned int)'
-----------------

Any help would be great.


--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to