Re: fwd declaration/dependency problem in 1.3.7



On Fri, 2003-10-03 at 01:38, Bowie Owens wrote:

> Is there some reason why you can't put the both in the same file? For 
> example the following:

[example removed]

That seems like the only workaround.

> If they have to be in separate files, you should stick with the forward 
> declarations and try something similar to what I recently suggested to 
> Robert Melby to get the .cc files to compile. See: 
> http://mail.gnome.org/archives/orbitcpp-list/2003-October/msg00001.html
> 

The problem with this solution is it won't work when #includes are
required by the IDL compiler. For example, if both Foo and Bar inherit
from Base I must #include "base.idl" in each file, which causes a
redefinition when I attempt to compile any file like:

foo-gen.cpp:

#include "bar-cpp.h"
#include "foo-cpp.cc"

The problem is both bar-cpp.h and foo-cpp.h (included by foo-cpp.cc)
have a definition for Base. If we could have the IDL compiler wrap the
definition of Base in each generated -cpp.h header with an #ifndef
guard, that would eliminate this problem.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]