Cannot run fitsio example

I am trying to run FITS_tutorial1.C. However, I get the following error:

Error: Symbol TFITSHDU is not defined in current scope  /opt/pi/ext/src/root/tutorials/fitsio/FITS_tutorial1.C:18:
Error: Symbol TFITSHDU is not defined in current scope  /opt/pi/ext/src/root/tutorials/fitsio/FITS_tutorial1.C:18:
Error: type TFITSHDU not defined FILE:/opt/pi/ext/src/root/tutorials/fitsio/FITS_tutorial1.C LINE:18
Warning: Automatic variable TFITSHDU*hdu is allocated /opt/pi/ext/src/root/tutorials/fitsio/FITS_tutorial1.C:18:
Error: Undeclared variable TFITSHDU*hdu /opt/pi/ext/src/root/tutorials/fitsio/FITS_tutorial1.C:18:
*** Interpreter error recovered ***

Root 5.32. Am I doing something wrong?

Same thing happens with the latest trunk…

Does you ROOT installation support “fitsio”? Try:
root-config --features | grep -i fitsio
root-config --has-fitsio

If not, you need to configure and build your ROOT from scratch adding “–enable-fitsio” (note: it requires external “cfitsio” library and include files). After the “./configure” step, make sure that the “config.log” file contains “Result: Enabled support for … fitsio …” somewhere near its end.

Thanks. I missed that the root configure could not find cfitsio. Now everything seems to be fine.