[Botan-devel] Problem with Botan LibraryInitializer

Muzaffar Mahkamov mahkamov at gmail.com
Thu Dec 15 13:08:55 EST 2005

You could do that yourself:

   LibraryInitializer init;

or use header guards (or #pragma once in VC) to avoid including the
header twice.

You could also make your own initializer class (afaik, C++ guarantees
that the class members are created in the order they're declared) and
declare LibraryInitializer as a static member in the first place, then
other members that use Botan library.

Thursday, December 15, 2005, 10:21:13 PM, you 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
>    LibraryInitializer init;
> #endif

> Thanks and best regards,

> -Carlton
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel

Best regards,
 Muzaffar                            mailto:mahkamov at gmail.com

More information about the botan-devel mailing list