your C++ compiler cannot handle class templates

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Vincent Daanen
Posts: 13
Joined: Wed, 2005-05-04, 15:05

your C++ compiler cannot handle class templates

#1 Post by Vincent Daanen »

Dear dcmtk users

what's that :shock:

I compile DcmTk 3.5.4 on a linux based pc (gcc -v = 3.4.1) with the following lines :
> ./configure --enable-std-includes --prefix = blablabla
> make
> make install-lib
> make distclean

When I want to compile my small application (which compiles and runs perfect on a MS Win XP pc), I got these errors :

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/ofstream.h:102: error: `strstream' does not name a type

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/ofstream.h:103: error: `ostrstream' does not name a type

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/ofstream.h:104: error: `istrstream' does not name a type

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/oflist.h:58:2: #error Your C++ compiler cannot handle class templates:

*/usr/GMCAO1/vdaanen-data/dcmtk-3.5.4/ofstd/include/dcmtk/ofstd/oflist.h:498:2: #error Your C++ Compiler is not capable of compiling this code


I really do not what to do since the C++ compiler [b]can handle class templates[/b] (I'm also using the Itk toolkit !)

I read the forum and the faq and did what was proposed but nothing change ! :cry: :x


Please help

Vincent

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 »

You probably forgot to define HAVE_CONFIG_H and/or to include "dcmtk/config/osconfig.h" as the first header file in your sources.

Vincent Daanen
Posts: 13
Joined: Wed, 2005-05-04, 15:05

#3 Post by Vincent Daanen »

so
I did this : add
-DHAVE_CONFIG_H and
#include "dcmtk/config/osconfig.h" as the first header file in my main.cpp

but it changes nothing :x

V

nadkio
Posts: 3
Joined: Thu, 2009-06-04, 13:38

Help

#4 Post by nadkio »

I try to compile my code but I get the same problem as posted by Vincent Daanen. Can someone help to resolve it.

Please :?: :?: :?:
nadkio

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

#5 Post by Marco Eichelberg »

My best guess is that something went wrong during the execution of the configure script. Re-run configure and see whether the script complains about anything. The #error output almost certainly means that cfunix.h (the header generated by configure and included by osconfig.h) does not contain what it should.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest