Dictionary generation for libtiff under windows

Hi,

I would like to use the libtiff library within Cint. So I made a Linkdef.h file and tried to run rootcint from windows command prompt. But it didn’t work.
I guess I either use the syntax under windows wrong in Linkdef.h or I didn’t copied the tiff library headers and dlls/libs to the proper place, etc.

I would need a little help.

My tiffLinkdef.h file looks like this (I am sure the pathes are not okay):

#ifdef CINT

#pragma link C++ defined_in c:\root\include\tif\tiff.h;
#pragma link C++ defined_in c:\root\include\tif\tiffconf.h;
#pragma link C++ defined_in c:\root\include\tif\tiffio.h;
#pragma link C++ defined_in c:\root\include\tif\tiffvers.h;

#pragma link C++ all;
#pragma link C++ all_function;
#pragma link C++ all_datamember;

#endif

I copied everything (*.h, *.dll, *.lib, etc) to my c:\root\include\tif folder for convenience - I don’t know if it is okay like this or not…

Then I run the rootcint:

C:\root\include\tif>rootcint.exe -f dicttiff.cxx -c -I"c:\root\include\tif\libti
ff" -p “c:\root\include\tif\tiff.h” “c:\root\include\tif\tiffconf.h” “c:\root\in
clude\tif\tiffio.h” "c:\root\include\tif\tiffvers.h"
2168831_cint.cxx
61688750_cint.cxx
Error: link requested for unknown class tiffconf .\g__auto1688linkdef.h(8)
Error: link requested for unknown class tiffio .\g__auto1688linkdef.h(9)
Error: link requested for unknown class tiffvers .\g__auto1688linkdef.h(10)
Warning: Error occurred during reading source files
Note: Link requested for undefined class tiff (ignore this message) (0)
Warning: Error occurred during dictionary source generation
!!!Removing dicttiff.cxx dicttiff.h !!!
Error: rootcint.exe: error loading headers…

Please tell what I do wrong.

Thanx,
Balint

Hi,
can you try it without directories, i.e. cd whereverTheTiffHeadersAre and then run rootcint, and adjust LinkDef.h accordingly (i.e. take just the file name)? Also, you should use link C, not C++, as from all I know libtiff is C.
Axel.

Hi,

I did what you suggested and it worked until I wanted to generat the shared lib with ACLiC. Here is what I got:

C:\root\include\tiff>rootcint.exe -f dicttiff.cxx -c -Ilibtiff -p tiff.h tiffcon
f.h tiffio.h tiffvers.h tiffLinkdef.h
21076281_cint.cxx

C:\root\include\tiff>root.exe -l
root [0] .L dicttiff.cxx++
Info in TWinNTSystem::ACLiC: creating shared library C:\root\include\tiff\dict
tiff_cxx.dll
23036312_cint.cxx
C:\root\include\tiff\dicttiff.h(8) : fatal error C1189: #error : dicttiff.h
/C is only for compilation. Abort cint.
Error: external preprocessing failed. (0)
!!!Removing C:\root\include\tiff\s22g_.cxx C:\root\include\tiff\s22g_.h !!!
Error: rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
dicttiff.cxx
C:\root/include\TDatime.h(90) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(90) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(92) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(92) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(94) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(94) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(96) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(96) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(98) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(98) : error C2248: ‘fDatime’ : cannot access protecte
d member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(100) : error C2248: ‘fDatime’ : cannot access protect
ed member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of 'fDatime’
C:\root/include\TDatime.h(100) : error C2248: ‘fDatime’ : cannot access protect
ed member declared in class 'TDatime’
C:\root/include\TDatime.h(34) : see declaration of ‘fDatime’
C:\root\include\tiff\dicttiff.cxx(150) : error C2501: ‘put’ : missing storage-cl
ass or type specifiers
C:\root\include\tiff\dicttiff.cxx(889) : error C2039: ‘put’ : is not a member of
’_TIFFRGBAImage’
C:\root\include\tiff\dicttiff.cxx(120) : see declaration of '_TIFFRGBAIm
age’
C:\root\include\tiff\dicttiff.cxx(2019) : warning C4003: not enough actual param
eters for macro 'DECLARE_HANDLE’
C:\root\include\tiff\dicttiff.cxx(2019) : error C2226: syntax error : unexpected
type ''
C:\root\include\tiff\dicttiff.cxx(2019) : error C2143: syntax error : missing ‘)
’ before '{'
C:\root\include\tiff\dicttiff.cxx(2019) : error C2143: syntax error : missing ‘;
’ before '{'
C:\root\include\tiff\dicttiff.cxx(2019) : error C2059: syntax error : ')'
C:\root\include\tiff\dicttiff.cxx(2019) : error C2059: syntax error : ';'
C:\root\include\tiff\dicttiff.cxx(2241) : error C2275: ‘thandle_t’ : illegal use
of this type as an expression
C:\root\include\tiff\tiffio.h(92) : see declaration of 'thandle_t’
C:\root\include\tiff\dicttiff.cxx(2241) : error C2146: syntax error : missing ‘)
’ before identifier 'TIFFClientdata’
C:\root\include\tiff\dicttiff.cxx(2241) : error C2059: syntax error : ')'
C:\root\include\tiff\dicttiff.cxx(2247) : error C2275: ‘thandle_t’ : illegal use
of this type as an expression
C:\root\include\tiff\tiffio.h(92) : see declaration of 'thandle_t’
C:\root\include\tiff\dicttiff.cxx(2247) : error C2146: syntax error : missing ‘)
’ before identifier 'TIFFSetClientdata’
C:\root\include\tiff\dicttiff.cxx(2247) : error C2059: syntax error : ')'
C:\root\include\tiff\dicttiff.cxx(2617) : error C2664: ‘TIFFClientOpen’ : cannot
convert parameter 3 from ‘int’ to 'struct thandle_t
*'
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
root [1]

Thanx,
Balint

Hi,
if you compile the dictionary with ACLiC it will create a dictionary for the dictionary. Not a good idea. You’ll have to use a Makefile to compile and link the dictionary.
Cheers, Axel.

Hi,

Okay. What do you suggest to do the compilation with under windows?

Balint

Hi,
cygwin and a Makefile. Or write a batch script, or type it in by hand each time. But cygwin + Makefile is best. Check test/Makefile for an example. ROOT cannot really help you with that (currently - we’ll have a new ACLiC in 1/2 year which will allow you to do just what you need).
Cheers, Axel.

Alternatively you can use ACLiC to run rootcint (and the compiler) for you:

[code]
// file tiff_loader.C
#include “tiff.h”
#include “tiffconf.h”
#include “tiffio.h”
#include "tiffvers.h’
#ifdef CINT

// WARNING: replace the following by the correct linkdef.h
// content :slight_smile:
#pragma link C++ defined_in c:\root\include\tif\tiff.h;
#pragma link C++ defined_in c:\root\include\tif\tiffconf.h;
#pragma link C++ defined_in c:\root\include\tif\tiffio.h;
#pragma link C++ defined_in c:\root\include\tif\tiffvers.h;

#pragma link C++ all;
#pragma link C++ all_function;
#pragma link C++ all_datamember;

#endif [/code]

and root [] .L tiff_loader.C+

Cheers,
Philippe