[Botan-devel] Re: Problem with Botan LibraryInitializer

Carlton Davis carlton at cs.mcgill.ca
Thu Dec 15 15:12:35 EST 2005


Muzaffar,

I did the following in two of the header files:

#ifndef BOTANLIBRARYINITIALISER
#define BOTANLIBRARYINITIALISER
LibraryInitializer init;
#endif

It still doesn't work: I got the following compile error
"error: redefinition of `Botan::LibraryInitializer init'
hdr_sr.h:72: error: `Botan::LibraryInitializer init' previously
declared here"

Thanks for your input though.

Best regards,

-Carlton


Thu Dec 15 13:08:55 EST 2005 Muzaffar Mahkamov wrote
> You could do that yourself:
>
> #ifndef BOTANLIBRARYINITIALIZER
> #define BOTANLIBRARYINITIALIZER
> LibraryInitializer init;
> #endif

On Thu, 15 Dec 2005, Carlton Davis wrote:

> Hello,
>
> I am using Botan in a routing protocol I plugged into a network
> simulator. When I try to compile the program, I get this error
> message: "multiple definitions of init". This is due to the line:
> "LibraryInitializer init;" appearing more than once in the included
> header file. I know that Jack mentioned in the Botan tutorial that
> the use of global botan variables is a bad idea, but I can't think
> of a way to avoid using the botan variables in the relevant header
> files because of the way the simulator code is written. My
> question is, is there a way to test if the Botan
> library has been initialized in an included header file,
> before doing the initialization (ie is it possible to do something
> of the sort
> #ifndef BOTANLIBRARYINITIALISER
>    LibraryInitializer init;
> #endif
>
> Thanks and best regards,
>
> -Carlton
>



More information about the botan-devel mailing list