Re: orbitcpp idl backend & --onlytop



rm wrote:

	thanks for looking at this so quick. orbit-cpp generates
output for the simple test case and my actual application. However;
when i try to compile the generated files the compiler dies after
encountering undeclared identifiers.

	if i then include the header files with the missing
definitions into the top of the -common header for the generated files,
it *does* work.
I should have commented on this in my previous email. This is the expected, but not entirely desirable behaviour. Because B.idl includes foo.idl inhibited'ly the definitions (or even forward declarations) of elements in foo will not appear in the generated code. This means B*.cc will not compile as generated. Since the inclusion is performed before the IDL backend gets hold of the file, we can't generate extra #includes in the generated code to include inhibited definitions/declarations (even the C binding doesn't).

	since i don't think you're supposed to edit the files one of a
couple things needs to happen: the -common.h needs to implicitly
include the non-toplevel definitions' header files, and leave it up to
the user to make sure the -I is setup so that they are found. i
suppose you could instead have forward declarations, but i don't know
if that's possible here. i believe orbit's c idl compiler takes the
former approach.
It is a bad idea to modify the generated files. The easiest thing to do is to create two extra files: B_some_suffix.h and B_some_suffix.cc. In the .h file include all the necessary header files and and in the .cc include the foo headers and the B-cpp.cc. So something like:

#include "foo-cpp-common.h"
#include "foo-cpp-stubs.h"
#include "foo-cpp-skels.h"
#include "B-cpp-common.cc"
#include "B-cpp-stubs.cc"
#include "B-cpp-skels.cc"

Then compile and link in B_some_suffix.o rather than B-cpp.o. You will have to do the same thing for the .c files as well.

I realise this is a bit of extra work, but you should only have to do it once. Plus it gives you complete control over the inclusion mechanism.



--
Bowie Owens

CSIRO Mathematical & Information Sciences
phone  : +61 3 9545 8055
fax    : +61 3 9545 8080
mobile : 0425 729 875
email  : Bowie Owens csiro au






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