problems with example

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
tj
Posts: 4
Joined: Fri, 2006-03-31, 14:47

problems with example

#1 Post by tj »

I try to get the example to write a DICOM file
from the online manual to work. I use the first lines
of the example:

Code: Select all

#define HAVE_CONFIG_H

#include <dcmtk/dcmdata/dcfilefo.h>
#include <dcmtk/dcmdata/dcdeftag.h>
#include <dcmtk/dcmdata/dcuid.h>

int main() {

  DcmFileFormat fileformat;
  DcmDataset *dataset = fileformat.getDataset();

  OFCondition status=dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage);
  if(status.bad()) cerr << "ERROR: " << status.text() << endl;


  return 0;
}
When I compile this on MacOS X 10.4 with dcmtk-3.5.4
using the line

Code: Select all

g++ dcmtest.cpp  -ldcmdata -lofstd -lz -o dcmtest
and execute it, I get the output

Code: Select all

ERROR: Illegal Call, perhaps wrong parameters
What is going wrong here and what does the error message mean?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

I would guess that dicom.dic is probably not installed where it belongs, i.e. by default in /usr/local/dicom/lib.

tj
Posts: 4
Joined: Fri, 2006-03-31, 14:47

#3 Post by tj »

OK, thanks!
I used

Code: Select all

--prefix=/Users/tj/MR-Software
to specify the installation directory when compiling dcmtk. When I set

Code: Select all

DCMDICTPATH=/Users/tj/MR-Software/lib/dicom.dic
the error vanishes. However, I was wondering why this doesn't work automatically. I digged into the code of dcmtk and found in config/include/dcmtk/config/cfunix.h

Code: Select all

#define DCM_DICT_DEFAULT_PATH "/Users/tj/MR-Software/share/dcmtk/dicom.dic"
This path contains my custom prefix, but it is not the correct path of the dictionary installed. Is this intentional?

Thanks a lot, Thies

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hi Thies,

this is a "known" bug when installing DCMTK using a custom prefix. We've fixed it already in the CVS.

Regards,
Michael

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest