On Sat, Sep 17, 2011 at 10:15 PM, Mouse <[email protected]> wrote:
> 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?
That's a damn good question, and I'd be interested in the answer from
the GCC folks or the OpenBSD maintainers.

> 2. Not on FreeBSD-4.8, but with G++ v.4.2.1 (on Mac OS X 10.6.8 and
> Xcode-4):
Since Lion and XC4, I've pretty much closed the lid on my MacBook.

> $ 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++ -v
Reading specs from /usr/bin/../lib/gcc-lib/i386-unknown-openbsd4.9/4.2.1/specs
Target: i386-unknown-openbsd4.9
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719
$

Jeff

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