rootcint error

From: OKUMURA, Akira <oxon_at_astro.isas.jaxa.jp>
Date: Sat, 15 May 2010 18:59:40 -0700


Hello ROOTers,

I am writing a ROOT program which controls USB chips provided by a private company FTDI. When I compile my code which includes ftd2xx.h written by FTDI, rootcint outputs the following errors.

$ make
Generating dictionary ...
rootcint -f src/TargetUSBDict.cxx -c -p inc/TBasePacket.h inc/TCommandPacket.h inc/TPacketDataWord.h inc/TResponsePacket.h inc/TSampleData.h inc/TTargetUtil.h inc/TUSBInterface.h inc/LinkDef.h

Error: class,struct,union or type __builtin_va_list not defined  /usr/include/i386/_types.h:96:
Error: Too many '}' /usr/include/sys/_select.h:57:
Error: Symbol pthread_cond_teCondVar is not defined in current scope  inc/ftd2xx.h:68:
Error: Symbol pthread_mutex_teMutex is not defined in current scope  inc/ftd2xx.h:69:
Error: Missing closing brace for the block opened around line 200.
Error: Unexpected end of file (G__exec_statement()) /var/tmp/tmp.0.NXjaqd_cint.cxx:2:
Warning: Error occurred during reading source files Warning: Error occurred during dictionary source generation !!!Removing src/TargetUSBDict.cxx src/TargetUSBDict.h !!! Error: rootcint: error loading headers... make: *** [src/TargetUSBDict.cxx] Error 1

I expected that this kind of errors were not generated if I ran rootcint with an option -p. But it didn't work in my situation. Then I added following to my header file.

#ifdef __CINT__
#undef __GNUC__
#define _SYS__SELECT_H_

struct pthread_cond_t;
struct pthread_mutex_t;
#endif

Thanks to these lines, some Darwin headers which cause rootcint errors are ignored when __CINT__ is defined. I believe they do not have any obvious side effect in my case.

But I was wondering if there were better solution to remove this rootcint errors. I might be doing something wrong. Could anyone give me any advise, please?

I am using OS X 10.6.3, ROOT 5.26.00b, and GCC 4.2.1. You can get ftd2xx.h from FTDI's official page. http://www.ftdichip.com/Drivers/D2XX/MacOSX/UniBin/D2XX0.1.7.dmg

Regards,

OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu} Institute of Space and Astronautical Science (ISAS/JAXA)



Now at KIPAC/SLAC/Stanford
Varian Physics #306
382 Via Pueblo Mall, MC 406 Stanford, CA94305 TEL 650-736-0971/FAX 650-724-5065
Skype : okumura.akira Received on Sun May 16 2010 - 03:59:53 CEST

This archive was generated by hypermail 2.2.0 : Sun May 16 2010 - 11:50:01 CEST