Rootcint problem

Hello,

I have got some problems with rootcint. I am using root version 5.22.0 on Ubuntu 8.10 (gcc 4.3.2). Whenever i try to generate dictionaries, I get the following error message:

rootcint -f BMS_RootDict.cc -c -I/opt/root/include -I/home/bastian/institut/geant4/bms/simulation/include -I/opt/geant4/9.2/include -I/usr/include BMS_Root.hh Linkdef.h
#error "You need a ISO C conforming compiler to use the glibc headers"
Error: Missing one of '
\/' expected at or after line 89.
Error: Unexpected end of file (G__fgetstream():2) /usr/include/sys/cdefs.h:382:
Error: Symbol extern"C"{ # define __need_size_t # define __need_NULL # include<stddef is not defined in current scope  /usr/include/stdio.h:45:
Error: Failed to evaluate extern"C"{ # define __need_size_t # define __need_NULL # include<stddef.h> # include<bits/types
Error: Failed to evaluate extern"C"{ # define __need_size_t # define __need_NULL # include<stddef.h> # include<bits/types.h> # define __need_FILE # define __need___FILE #endif #if !defined __FILE_defined&& defined __need_FILE struct _IO_FILE
Error: Symbol __BEGIN_NAMESPACE_STDtypedefstruct_IO_FILEFILE is not defined in current scope  /usr/include/stdio.h:49:
Error: Missing one of '{' expected at or after line 91.
Error: Unexpected end of file (G__fignorestream():3) /usr/include/stdio.h:917:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing BMS_RootDict.cc BMS_RootDict.h !!!
Error: rootcint: error loading headers...
make: *** [BMS_RootDict.cc] Error 1

As far as I can tell the issue has already been discussed in root.cern.ch/phpBB2/viewtopic.php?t=5672 but I couldn’t find a solution there.

Any ideas?

Cheers
Bastian

Hi,

don’t add -I/usr/include.

Cheers, Axel.

Thanks, that did the trick.

I have a very similar problem, but I don’t have -I /usr/include in my rootcint command (as far as I can tell…). What could be my problem then?

I just upgraded from 5.18 to 5.22 and the problem only occurs in 5.22. Here’s what I do:

/scratch/extlib/root-5.22.00/bin/rootcint -f TXaDictionary.cc -c -DNO_EPICS  -DNO_HDF5  TXaMainFrame.h TXaImage.h TXaStyle.h TXaUtil.h TXaTwiss.h TXaPgmUtil.h TXaPgmAsciiUtil.h TXaBinManager.h TXaTab.h TXaHDF5FileDialog.h TXaEPICSDialog.h TXaHDF5Reader.h XanaROOTLinkDef.h

…and here’s the result:

Error: cannot open file "typeinfo"  /home/scratch/extlib/root-5.22.00/include/Rtypeinfo.h:33:
#error "You need a ISO C conforming compiler to use the glibc headers"
Error: Missing one of '
\/' expected at or after line 88.
Error: Unexpected end of file (G__fgetstream():2) /usr/include/sys/cdefs.h:289:
Error: Symbol extern"C"{ # define __need_size_t # define __need_NULL # include<stddef is not defined in current scope  /usr/include/stdio.h:46:

...etc.

I am using Scientific Linux 4, gcc version 3.4.6 and root_v5.22.00.Linux.slc4.gcc3.4.tar.gz.

Any advice? Thanks,

Thomas

Never mind… I had a mixup with my LD_LIBRARY_PATH… sorry to bother you!

Just a comment about this problem.

First, this post help me to solve my problem, but it is not a good solution (in my mind).

I got the same problem compiling a program with rootcint using -I/usr/include

Unfortunately, the program I used needed the log4cxx header and library that I had installed (long ago) in /usr/include and /usr/lib directories. And off course, when I used rootcint … -I/usr/include … , I got the same problem. I solved it by creating a new directory and by copying all the headers in this new directory. But I think that is not a good solution to solve that problem. And it will be nice this bug is fixe in future.

Note that I used root v5.20 et gcc.4.4 on apple Os X 10.5

Hi,

I completely agree that -I/usr/include should be possible. But until it is, copying the headers to generate the dictionary is a reasonable solution.

Cheers, Axel.

hello!
I have read the content above, but still I can not solve my problem.
My system is Ubuntu 8.10,

My gcc version is as follows:
Using built-in specs.
Target: i486-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 4.3.2-1ubuntu12’ --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

I use the ’ apt-get install rootsys ’ to install the root on my machine, the version is 5.18/00b

I wirte a small code:

[code]#include <stdio.h>

#include <iostream.h>

#include “iomanip.h”

#include<fstream.h>

gROOT->Reset();

void a()
{
A1 = new TH1F(“A1”,“A1”,100,0,4100);
A1->Fill(50);
TCanvas *c1 = new TCanvas(“c1”,“c1”,0,0,780,600);
c1->cd();
A1->Draw();
c1->Print(“A1.ps”);
cout<<“This is A1”<<endl;
}[/code]

When I run this code using ’ root a.C ', it is all right.
However, if I use:

$ g++ -L/usr/lib/root -I/usr/include/root a.C

it displays:

a.C:2:22: error: iostream.h: No such file or directory
a.C:3:21: error: iomanip.h: No such file or directory
a.C:4:20: error: fstream.h: No such file or directory
a.C:7: error: expected constructor, destructor, or type conversion before ‘->’ token
a.C: In function ‘void a()’:
a.C:10: error: ‘A1’ was not declared in this scope
a.C:10: error: expected type-specifier before ‘TH1F’
a.C:10: error: expected `;' before ‘TH1F’
a.C:12: error: ‘TCanvas’ was not declared in this scope
a.C:12: error: ‘c1’ was not declared in this scope
a.C:12: error: expected type-specifier before ‘TCanvas’
a.C:12: error: expected `;' before ‘TCanvas’
a.C:16: error: ‘cout’ was not declared in this scope
a.C:16: error: ‘endl’ was not declared in this scope

Hi,

You should use g++ `root-config --cflags --libs`. You will also need to create a main function and create a TApplication object …

Or more simply you could use ACLiC:root a.C+ (you will still need to remove the stray ‘gROOT->Reset();’ )

Cheers,
Philippe.

Thank you, pcanal!

But it display:
[ul]g++: root-config --cflags --libs: No such file or directory
a.C:2:22: error: iostream.h: No such file or directory
a.C:3:21: error: iomanip.h: No such file or directory
a.C:4:20: error: fstream.h: No such file or directory
a.C:7: error: expected constructor, destructor, or type conversion before ‘->’ token
a.C: In function ‘int main()’:
a.C:10: error: ‘A1’ was not declared in this scope
a.C:10: error: expected type-specifier before ‘TH1F’
a.C:10: error: expected ;' before ‘TH1F’ a.C:12: error: ‘TCanvas’ was not declared in this scope a.C:12: error: ‘c1’ was not declared in this scope a.C:12: error: expected type-specifier before ‘TCanvas’ a.C:12: error: expected;’ before ‘TCanvas’
a.C:16: error: ‘cout’ was not declared in this scope
a.C:16: error: ‘endl’ was not declared in this scope
[/ul]

Hi,

Then it means that $ROOTSYS/bin is not in your path. I strongly recommend your consider simply relying on ACLiC to build your libraries.

Cheers,
Philippe.

Thank you, pcanal!
The ACLiC can work. :smiley: