__signed__ type in rootcint

Hello ROOT community,

I am having trouble generating a root dictionary to access my class from within ROOT. I should say that I have successfully added my classes to ROOT in the past (thanks to the useful online tutorials). But this particular custom class refers to problematic typdef statements. It appears that rootcint does not know about a particular data type, called signed. The g++ compiler, however, does understand signed.

Here is a test case class that exhibits the problem:

//----Scope.hh-------
#ifndef SCOPE_HH
#define SCOPE_HH

#include “TString.h” // include any root file for ClassDef()
//#include “AlazarApi.h” // --> this is the problematic line

class Scope {
public:
Scope();
void Print();
ClassDef(Scope,1)
};
#endif
// – end of file

// ----- Scope.cc -----
#include “Scope.hh”
#include
ClassImp(Scope)
using std::cout;
using std::endl;

Scope::Scope() { cout << “Scope constructor” << endl; }
void Scope::Print() { cout << “Scope.Print()” << endl; }
// – end of file

The class, as listed above compiles and I can successfully generate a dictionary using rootcint and I can access the Scope class from within ROOT. However, if I uncomment the
#include "AlazarApi.h"
line, then I get the following error in rootcint (although the code does compile in g++ just fine):

$ make
Compiling… for linux
g++ -O -Wall -fPIC -pthread -I/usr/local/cern/root/include -c Scope.cc
Generating dictionary …
/usr/local/cern/root/bin/rootcint -f ScopeCint.cc -c Scope.hh
Error: class,struct,union or type signed not defined /usr/include/asm/types.h:11:
Error: class,struct,union or type signed not defined /usr/include/asm/types.h:14:
Error: class,struct,union or type signed not defined /usr/include/asm/types.h:17:
Error: class,struct,union or type signed not defined /usr/include/asm/types.h:21:
Error: class,struct,union or type __s8 not defined /usr/include\linux/types.h:78:
Error: class,struct,union or type __s16 not defined /usr/include/linux/types.h:80:
Error: class,struct,union or type __s64 not defined /usr/include/linux/types.h:93:
Error: class,struct,union or type __s8 not defined AlazarApi.h:39:
Error: class,struct,union or type __s16 not defined AlazarApi.h:41:
Error: class,struct,union or type __s64 not defined AlazarApi.h:45:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing ScopeCint.cc ScopeCint.h !!!
Error: /usr/local/cern/root/bin/rootcint: error loading headers…
make: *** [ScopeCint.cc] Error 1

The relevant line in AlazarApi.h is:
#include <linux/types.h>

The header file linux/types.h in turn includes asm/types.h, which uses signed, a symbol that rootcint does not know about, but g++ does know about.

I’ve spent a good deal of time on google to find out how g++ knows what signed is, in the hopes that I could pass that information to rootcint, but have had no success thus far.

I recognize that this issue may be more of a Linux question than a rootcint question, but hopefully someone in the ROOT community may have experienced a similar issue, or may have some suggestions. Any help would be greatly appreciated.

Thank you very much in advance,
James

Hi,

add
#ifdef CINT
typedef int signed;
#endif
before the inclusion of AlazarApi.h. Does that help?

Cheers, Axel.