Boost logo

Boost Users :

Subject: [Boost-users] [system] static linking + static member in y a dynamic design
From: Amoriello Hutti (amoriello.hutti_at_[hidden])
Date: 2011-04-17 17:17:40

Hi everyone,

I am facing a "design" issue while sharing error_codes across modules

Has I understand the design, error_categories like
"generic_error_category" are static (maybe to provide unique way to
represent error_category, avoiding error_category ID confilct, and
allowing users to extend with there own categories).

The question is :
How can we share error_code across modules (A and B), when these
modules are both statically linked with there own boost::system
library (same version)?

Under Windows operating system, both static version of boost::system
library co-exist in the same process address space (that contains
module A and module B), they do not share code or static data members.

Comparison between error_code is made by looking error_value and
error_category, but error_categroy doesn't has the same "static"
address, causing comparison to fail, even when the semantic is
respected (because of the co-existing static error_category with
different address).

sharing the boost::system has a unique shared library used by both
module A and B could solve this issue, but this solution is not
suitable for certain needs.

Thanks for your help!

Amoriello Hutti

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at