Opened 10 years ago

Closed 10 years ago

#7999 closed Bugs (fixed)

Multiple compilation errors due to circular header inclusion dependency

Reported by: francisco.mailing.lists@… Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: francisco.mailing.lists@…

Description

In file included from libs/math/build/../src/tr1/assoc_laguerre.cpp:10:

In file included from ./boost/math/tr1.hpp:383:

In file included from ./boost/math/tools/promotion.hpp:26:

In file included from ./boost/math/tools/config.hpp:25:

./boost/math/special_functions/detail/round_fwd.hpp:24:13: error: use of undeclared identifier 'tools'

typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);


promotion includes config, config includes round_fwd, round_fwd includes promotion.

config.h seems to not need to include round_fwd.h, since from what I've checked, what it used from round_fwd.h is inside a definition of a macro (BOOST_MATH_STD_USING), hence no compile time dependency.

Change History (4)

comment:1 by anonymous, 10 years ago

Well, just removing the include from config.h wont solve either (as expected).

comment:2 by francisco.mailing.lists@…, 10 years ago

I've not thought it throughout, the include guards should prevent this, I'm using clang... not sure where the problem may lie anymore.

comment:3 by francisco.mailing.lists@…, 10 years ago

oh yeah, promotion.h includes config.h on on top, config.h includes round_fwd.hpp, round_fwd.hpp includes promotion.h, which includes nothing because of the guards of the first inclusion, and them goes on using declaration from promotion.h which is still not expanded.

comment:4 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [82921]) Fix cyclic dependency. Fixes #7999.

Note: See TracTickets for help on using tickets.