Compilation errors with Dictionary _classdef.cpp (ROOT 6.08/02)

I’ve gotten a lot of help here and I’m close to having a working dictionary generated for my project. However, the EspressoDict_classdef.cpp file generated for my project does not compile. My dictionary includes I/O customizations, and the problem seems to be related to these. My XML file looks like

<lcgdict>
  ...
  <class name="espresso_block">
    <field name = "data" transient = "true"/>
  </class>
  <class name="espresso_vector" />
  <class name="espresso_matrix" />
  <ioread version="[1-100]"
	  sourceClass="espresso_vector"
	  source="size_t size; double* data;"
	  targetClass="espresso_vector"
	  target="block"
          include="TVirtualObject.h"
	  >
    <![CDATA[{
    block = new espresso_block();
    block->size = onfile.size;
    block->data = onfile.data;
    }]]>
  </ioread>
  <ioread version="[1-100]"
	  sourceClass="espresso_matrix"
	  source="size_t size; double* data;"
	  targetClass="espresso_matrix"
	  target="block"
          include="TVirtualObject.h"
	  >
    <![CDATA[{
    block = new espresso_block();
    block->size = onfile.size;
    block->data = onfile.data;
    }]]>
  </ioread>
</lcgdict>

I added the include="TVirtualObject.h" lines in a blind attempt to solve the problem, but they had no effect. genre flex runs with no errors or warnings; however, the resulting project (including EspressoDict_classdef.cpp) does not compile. Instead, a number of errors are produced, the primary ones being

T/Espresso/EspressoDict_classdef.cpp:99:54: error: ‘TVirtualObject’ has not been declared
    static void read_espresso_vector_0( char* target, TVirtualObject *oldObj )
                                                      ^
FT/Espresso/EspressoDict_classdef.cpp: In function ‘void ROOT::read_espresso_vector_0(char*, int*)’:
...
FT/Espresso/EspressoDict_classdef.cpp:118:14: error: ‘TClassRef’ does not name a type
       static TClassRef cls("espresso_vector");
              ^
...

Manually adding the line and continuing the compilation seems to work…

@pcanal should be able to help…

This is strange … There ought to be a #include "TVirtualObject.h" in the file EspressoDict_classdef.cpp. Is it missing?

Hi Philippe - Yes, it is missing, and I can finish compilation by adding it manually. There is another file “EspressoDict.cpp” that does have #include "TVirtualObject.h". Perhaps this is a problem in my local environment or the chain of commands that I run? The project I’m working on is quite large (as you know from the many threads where you’ve offered excellent advice) and it’s hard to share too many details, unfortunately.

Could you post the header you provide to genreflex that produces this dictionary with the missing include? What happens if you add the include of TVirtualObject.h there?

Axel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.