On 9/17/11 21:06 PM, Jeffrey Walton wrote: > On Sep 12, 12:10 am, Jeffrey Walton <[email protected]> wrote: >> Hi All, >> >> Has anyone come across an error using Crypto++ on OpenBSD 4.8? I seem >> to have a problem in my program when using Crypto++ (Crypto++ itself >> builds and tests OK). >> >> OpenBSD 4.8 uses GCC 4.2.1, and the GCC bug was fixed in GCC 4.3.0 >> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34009). The first >> offending item from cryptlib.h:99 is the template below: >> >> // VC60 workaround: using enums as template parameters causes problems >> template <typename ENUM_TYPE, int VALUE> >> struct EnumToType >> { >> static ENUM_TYPE ToEnum() {return (ENUM_TYPE)VALUE;} >> >> }; >> >> $ gmake test >> g++ -g2 -ggdb -O0 -DSAFEINT_DISALLOW_UNSIGNED_NEGATION=1 -pipe >> -fsigned-char -fmessage-length=0 -Woverloaded-virtual -Wreorder >> -Wformat=2 -Wformat-security -Wno-unused -fvisibility=hidden >> -fstack-protector -I. -I./esapi -I./deps -I/usr/local/include -fpic -c >> test/crypto/PlainTextTest.cpp -o test/crypto/PlainTextTest.o >> In file included from /usr/include/cryptopp/misc.h:4, >> from ./esapi/crypto/Crypto++Common.h:24, >> from ./esapi/crypto/PlainText.h:19, >> from test/crypto/PlainTextTest.cpp:29: >> /usr/include/cryptopp/cryptlib.h:99: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:247: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:254: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:261: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:268: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:293: error: template with C linkage >> /usr/include/cryptopp/cryptlib.h:698: error: template with C linkage >> [SNIP] > The problem was installing Crypto++ into /usr/include and /usr/lib. > The makefile needed to be modified to install into /usr/local/include > and /usr/local/lib (thanks to Marc Glisse on GCC mailing list). >
Jeffrey, 1. What does the location of the include and lib files have to do with the compilation error? 2. Not on FreeBSD-4.8, but with G++ v.4.2.1 (on Mac OS X 10.6.8 and Xcode-4): $ g++ -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5666.3~123/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5666) (dot 3) g++ -O6 -pipe -fPIC -m64 -ffunction-sections -fdata-sections -c ui-r1.cpp g++ -o ui-r1 ui-r1.o -lcryptopp $ ./ui-r1 Begin Receiver test: retrieving ECIES keys at Sat Sep 17 22:13:43 2011 Validation of retrieved EC keys: OK Got 48 bytes for 256-bit key and 128-bit IV Set AES key and IV... Created and configured AES decryptor... Running AES decryption... Have 500 bytes ready in total Got 100 (out of 500) bytes: "This is a test and example of Crypto++ usage." Got 100 (out of 400) bytes: "Output string number 1 " Got 100 (out of 300) bytes: "Output string number 2 " Got 100 (out of 200) bytes: "Output string number 3 " Got 100 (out of 100) bytes: "Output string number 4 " Test completed successfully at Sat Sep 17 22:13:43 2011 $ -- Regards, Mouse -- 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.
