compiling dcmtk with qt and kdevelop on ubuntu.

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
magik51
Posts: 4
Joined: Tue, 2005-06-28, 20:32

compiling dcmtk with qt and kdevelop on ubuntu.

#1 Post by magik51 »

Hi to all,

i don't find a topic with it, so i'm sorry if there is one topic about it.

I have some errors when i try to compil dcmtk with qt 3.

1 - i create a qt application.
2 - i include osconfig.h and dctk.h.
3 - i try to compil and i have errors:
...
#error DCMTK needs stringstream or strstream type
...
#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning
...
error: `assert' undeclared (first use this function)
...
../../dicom/include/ofstd/oflist.h:58:2: #error Your C++ compiler cannot handle class templates:
../../dicom/include/ofstd/oflist.h:498:2: #error Your C++ Compiler is not capable of compiling this code
...
#error "DCM_DICT_DEFAULT_PATH is not defined via osconfig.h

i think i have missed something but i don't find what.

Please could you help me?

Thank you for any help.

Nik

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Seems like the compiler is including the wrong "osconfig.h" and/or "cfunix.h" header files. Make sure that the directory settings (-I) are correct.

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#3 Post by focus »

I had the same error with mandrake 10.1 the solution is put in all our classes this define

#define HAVE_CONFIG_H 1

you specified that you are using LINUX, with this in my case I solve the problem

Good Luck!

magik51
Posts: 4
Joined: Tue, 2005-06-28, 20:32

#4 Post by magik51 »

Hi,

thanks to Jörg and focus for your answers.

I have puted #define HAVE_CONFIG_H 1 on my classe and i don't have any errors messages (very good thanks).

Now when i uses this code in one of my functions:

Code: Select all


DcmFileFormat fileformat;
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;
} else
  cerr << "Error: cannot read DICOM file (" << status.text() << ")" << endl;
when i try to compil it i have this error:

error: request for member `findAndGetOFString' in ` (&fileformat)->DcmFileFormat::getDataset()', which is of non-aggregate type `DcmDataset*'

I try many things but don't see what is missing.

Can help me another time please?

Thank you very much for your time.

Nik

wrgben
Posts: 20
Joined: Thu, 2005-01-06, 10:53

#5 Post by wrgben »

getDataset() returns a pointer to a DcmDataset. So you need to use the -> operator rather than the . operator:

Code: Select all

fileformat.getDataset()->findAndGetOFString(DCM_PatientsName, patientsName)

magik51
Posts: 4
Joined: Tue, 2005-06-28, 20:32

#6 Post by magik51 »

Hi,

ho i think i was tired when i try to do it :D sorry.

i have resolved all my problems,

i just have to put in the right order the linking library.

Thank for all your help.

Nik

Post Reply

Who is online

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