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
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.
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
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
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]