Visual Studio Linker Issue with TASImage

Howdy,
I have been working on some image analysis and am working on a program that sums a set of images before the analysis is done on the summed image. The program was compiling fine using ROOT 5.18 on Visual Studio 2005 until I tried to convert the summed array into a TASImage object. The summation algorithm and the TASImage object creation work as a macro in CINT, however, i get some unresolved externals when I compile. I have tried variations of the TASImage’s constructors but all with the same results. Some insight on the matter would be much appreciated. Here is some code and the error messages.

The TASImage constructor call that causes all the trouble

imgOut_ = new TASImage("imageSum",picArrayOut_->GetArray(),width_,height_,myPalette_);

In the above code imgOut_ & picArrayOut_ are declared in the header as:

TASImage * imgOut_;				///< Output image.

TArrayD * picArrayOut_;			///< Array to hold summed array.

The palette is defined as:

TImagePalette * myPalette_;		///< Color palette for the image.

// initialize color palette
	nump_ = 256;
	myPalette_ = new TImagePalette(nump_);
	for (int i=0; i<nump_; i++) {
		myPalette_->fPoints[i]=(Double_t) i/nump_;
		myPalette_->fColorRed[i]=((UShort_t) i) << 8;
		myPalette_->fColorGreen[i]=((UShort_t) i) << 8;
		myPalette_->fColorBlue[i]=((UShort_t) i) << 8;
		myPalette_->fColorAlpha[i]=((UShort_t) 255) << 8;
	}

The linker error when I try to compile is:

Error	1	error LNK2019: unresolved external symbol "public: __thiscall TASImage::TASImage(char const *,double const *,unsigned int,unsigned int,class TImagePalette *)" (??0TASImage@@QAE@PBDPBNIIPAVTImagePalette@@@Z) referenced in function "public: __thiscall imageData::imageData(void)" (??0imageData@@QAE@XZ)	imageData.obj

Error	2	fatal error LNK1120: 1 unresolved externals	f:\xinray_data\Andrew\focus_spot\ImageEval\source\Release\ImageEval.exe

While these difficulties could be arising from my difficulty in understanding the way the linker is given commands in the LinkDef.h, perhaps the contents of that file will be enlightnening.

#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class GuiMainFrame+;
#pragma link C++ class histProperties+;
#pragma link C++ class image+;
//#pragma link C++ class imageData+;

#endif

The image class holds all the instances of the images with their palletes, dimensions, and the original TImage before they are converted to histograms for summation. imageData is commented out because it no longer inherits from TObject. It is the class in which the summation occurs and where the troublesome line is located (in the constructor of the class). Thanks again for any help you might be able to provide me with.
Cheers,
Andrew

Hi,

The ‘link’ referred to in the LinkDef file is not the same ‘linker’ that leads to the missing symbol error. The link in LinkDef is requesting the generation of a dictionary for a C++ symbol. The ‘dictionary’ is information that is stored in the CINT data structure.

The missing symbols means that you need to add libASImage to you executable link line (i.e. to the list of library dependency in visual studio).

Cheers,
Philippe.

Philippe,
Thanks for the clarification of the dictionary. Your suggestion of adding the library worked like a charm. Compiled and ready to go.
Cheers,
Andrew