[aspectc-user] Boost problems
os at aspectc.org
Fri Jul 23 17:05:17 CEST 2010
thanks for providing your files on a linked web page. This is very helpful.
The definition of your aspect InterestCalculator is lacking a semicolon
at the end. Furthermore, I'd recommend to use an include guard in every
aspect header file.
However, even if you fix these issues, ac++ will have problems with the
boost headers that you are using here. boost is based on very
sophisticated template features and makes use of a lot of conditional
compilation in order to cope with the different interpretations of the
C++ standard as is implemented by the supported compilers. Therefore,
ac++ still has problems with boost. Even though we are continuously
improving the parser, I wouldn't expect a short-term solution. Sorry.
Your second question was whether you could restrict the set of woven
files. This is possible, but a bit tricky. You have to know what you are
If you use the "single translation unit mode", e.g. by weaving and
compiling with ag++, you are free to use ag++ for some files of your
project and g++ for the rest. However, this will only work if the
weaving process does not affect any header files that are shared between
both groups of translation units. If the files that are compiled with
g++ depend on modifications in header files, e.g. introduced attributes
in a class, you need to create transformed header files with the ag++
command line option "-i". However, this will transform *all* header
files of the project, which means that header files must not include
critical boost headers. :-( I don't know if this is possible in your case.
Also note that you can filter the code that is parsed by ac++ with
#ifndef __puma ... #endif. However, you can't simply hide the inclusion
of boost header files with this feature, because the boost definitions
will probably be needed at many points in your code. At all these places
you would also have to use #ifndef __puma.
I hope this helps a little.
Abe S. wrote:
> Hi all,
> I have a medium-sized project (Over 200 but less than 300 files) which
> makes fairly heavy use of Boost for threading, messaging, and
> configuration parsing. I am trying to use AspectC to add
> interestingness and abstractness metrics to data being processed by
> the system. If that works, I'm probably also going to move the logging
> over to an aspect.
> I've used AspectC on a small sample program, and been very pleased
> with the results. However, when I attempt to add a "hello world"
> aspect to one of the classes of the existing project, I get a large
> variety of error messages, most of which include some reference to
> boost header files.
> It looks much like the error messages reported in:
> I have attempted to work around this by using the --weave_only option
> and then compiling the woven source as normal, but the weaving appears
> to be the part that fails. Using --real-instances causes a different
> initial error, and then the same errors as not using it.
> Is there a way to restrict the weaver to only working with a subset of
> the source files, so that I can have it ignore anything from the boost
> If it's useful (and even if it's not), the full error messages, aspect
> header, and source file are in
> aspectc-user mailing list
> aspectc-user at aspectc.org
More information about the aspectc-user