gczajkow Posted November 24, 2015 Report Share Posted November 24, 2015 Hello all, I am finding that SystemC 2.2 cannot harmoniously compile with boost 1.58 when -DSC_INCLUDE_DYNAMIC_PROCESSES is defined. It creates a condition where SystemC's embedded boost declarations are previously defined in the real boost. Is there any workaround for this without completely hacking SystemC's boost sources to properly embed boost in "sc_boost" namespace instead of it colliding with the boost namespace from a different release? Details of an example error: In file included from /tmp/systemc/include/sysc/kernel/sc_boost.h:58:0, from /tmp/systemc/include/sysc/kernel/sc_dynamic_processes.h:54, from /tmp/systemc/include/systemc:94, from ExampleX.h:32, from Example.h:32, from Example.cpp:25/tmp/systemc/include/sysc/packages/boost/ref.hpp:31:25: error: redefinition of 'class boost::reference_wrapper<Type>'In file included from /tmp/boost/1.58.0/boost/ref.hpp:15:0, from /tmp/boost/1.58.0/boost/tuple/tuple.hpp:27, from /tmp/boost/1.58.0/boost/multi_index/detail/index_base.hpp:28, from /tmp/boost/1.58.0/boost/multi_index/detail/base_type.hpp:21, from /tmp/boost/1.58.0/boost/multi_index_container.hpp:34, from ExampleY.h:24, from Example.h:27, from Example.cpp:25: PS. We aren't able to move to SystemC 2.3, but would like to know if this was solved in recent editions? Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted November 25, 2015 Report Share Posted November 25, 2015 In SystemC 2.3.1 it is in sc_boost namespace: ref.hpp: namespace sc_boost { template<class T> class reference_wrapper Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted November 26, 2015 Report Share Posted November 26, 2015 (edited) As Roman pointed out, these symbol clashes have been avoided since SystemC 2.3 by moving the embedded copy to the sc_boost namespace. In SystemC 2.2, you can try to get away with it by explicitly including all duplicate headers from the recent Boost version first, i.e. before including SystemC (hoping that the include guards have not been changed). For those files, where the include guards have changed, you need to explicitly #define the sentinels as well to hide their duplicate inclusion. There still be dragons, though. hth, Philipp Edited November 26, 2015 by Philipp A. Hartmann Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.