Loading external libs under windows

Hi,

I would like to use an external library (libtiff) in Cint under windows.
gSystem->Load(“libtiff3.dll”); ? Or do I have to load or set other things as well?

Thanx,

Balint

[quote=“radbalint”]Hi,

I would like to use an external library (libtiff) in Cint under windows.
gSystem->Load(“libtiff3.dll”); ? Or do I have to load or set other things as well?

Thanx,

Balint[/quote]Normally, Windows DLL loads all related DLLs automatically.
It should be sufficient to load just libtiff3.dll alone. Just try , to see whether it failes :wink:

Hi,

It fails.

The script is:

//----------------------------
#include “tiffio.h”

void testtiffio(char * f){
TIFF * tiff = TIFFOpen(f, “r”);
TIFFClose(tiff);
}
//----------------------------

root [0] gSystem->Load(“libtiff3.dll”);
root [1] .x testtiffio.C(“H-Ti-Rydberg8.TIF”);
Error: Function TIFFOpen(f,“r”) is not defined in current scope C:\root\include\testtiffio.C(4)
*** Interpreter error recovered ***

Although the “TIFFOpen” function is in the tiffio.h:

extern TIFF* TIFFOpen(const char*, const char*);

Balint

[quote=“radbalint”]
root [0] gSystem->Load(“libtiff3.dll”);
root [1] .x testtiffio.C(“H-Ti-Rydberg8.TIF”);
Error: Function TIFFOpen(f,“r”) is not defined in current scope C:\root\include\testtiffio.C(4)
*** Interpreter error recovered ***

Although the “TIFFOpen” function is in the tiffio.h:

extern TIFF* TIFFOpen(const char*, const char*);[/quote]This does not manifest any trouble with the DLL loading. To be able to use that function from CINT one has to either create Cint dictionary :exclamation: for that package or apply ACLiC. Apparently, the original DLL doesn’t contain :bulb: any CINT dictionary.
See: root.cern.ch/root/doc/RootDoc.html
Chapter “CINT the C++ Interpreter” ftp://root.cern.ch/root/doc/chapter7.pdf

The $ROOTSYS/cint/lib
directory contains the various examples of creating the CINT dictionary for 3d party packages (see “qt” subdirectory for example)

On the other hand I believe you can merely use ROOT TImage class root.cern.ch/root/htmldoc/TImage … escription
or Qt QImage class doc.trolltech.com/3.3/qimage.html rather libtiff directly.
Try $ROOTSYS/tutorials/rose_image.C $ROOTSYS/tutorials/imgconv.C
macros. Replace there the file name TImage *img = TImage::Open("rose512.jpg");with your file name

Hi Balint,
see e.g. root.cern.ch/phpBB2/viewtopic.php?t=3488 on how to create a dictionary for an external library.
Cheers, Axel.