Compile dictonnary using external library using cmake


I am a novice with cmake, and I have some difficulties… I am developing a program using root, and one external library. All is compiled using cmake, and I have built the dictionaries for the different libraries that I am developing using :

ROOT_GENERATE_DICTIONARY(G__${PROG_NAME} ${headersdict} LINKDEF ${SourceDir}/LinkDef.h )

This is working fine for all my classes except one. The one for which I have problems is a class that have in its elements an object from an external library. (This library is well loaded in the cmake, I can use it, but not in a class for which I need to build a dictionnay). The compilation pass, but at the execution, I obtain the following errors:

ASMainWindow.h:14:10: fatal error: ‘GSpectra.h’ file not found
#include “GSpectra.h”
Error in TInterpreter::AutoParse: Error parsing payload code for class ASMenuBar with content:

#line 1 “libAgaSpy dictionary payload”

Do I need to do something special when building the dictionnary to take into account the fact that the class is using an external library ?

I hope this is clear enough…

Thanks in advance


Problem resolved by using ClassDef(Class,0) instead of ClassDef(Class,1)

At the end, the real solution was to add the include path of the external library in the root environment variable ROOT_INCLUDE_PATH

You should probably not play with the ${ROOT_INCLUDE_DIR} variable. Instead you should inform CMake that there is an additional path to search for includes:


I have tried what you propose but It doesn’t work. The compilation works, but this is at the execution that the programs need to know where are these headers for the dictionnary

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