Hi,
please see the following code (it is from one of the earlier posts):

/*--------------------------------------*/
#include
#include "dctk.h"

int main()
{

DcmFileFormat *fileformat = new DcmFileFormat();
OFCondition status = fileformat->loadFile("test.dcm");
if (status.good())
{
OFString patientsName;
if ((fileformat->getDataset())->findAndGetOFString(DCM_PatientsName,
patientsName).good())
{
cout << "Patient's Name: " << patientsName << endl;
} else
cerr << "Error: cannot access Patient's Name!" << endl;

//fileformat->print(cout);

}
else
cerr << "Error: cannot read DICOM file (" << status.text() << ")"
<< endl;

}

/*--------------------------------------*/

g++ -Wall test.cpp -Iconfig/include -Iofstd/include -Idcmdata/include
-Ldcmdata/libsrc -Lofstd/libsrc -ldcmdata -lofstd -lrt -lpthread -lnsl
-lm -lz -Wno-deprecated

The Error Generated is:
/tmp/ccJvZO5W.o: In function `main':
/tmp/ccJvZO5W.o(.text+0x108): undefined reference to
`DcmItem::findAndGetOFString(DcmTagKey const&, OFString&, unsigned
long, int)'
collect2: ld returned 1 exit status


Which other library should i include for proper linking?

TIA,
Kaustubh