• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Objective-C++ newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Objective-C++ newbie questions


  • Subject: Objective-C++ newbie questions
  • From: Rick Hoge <email@hidden>
  • Date: Wed, 2 Jun 2004 10:04:18 -0400

Hi -

I'm trying to use some C++ libraries (dcmtk for reading DICOM files) in our Objective-C/Cocoa app and, while I've got some basic C++-isms to build and run (e.g. cout << "Hello World!" << endl;) I'm already having trouble with some includes I need to use the actual libs. To get "hello world" to work (I realize this doesn't exercise much C++), I included iostream.h and gave my implementation file the .mm extension.

When I add the first include needed for dcmtk, the build starts failing (see below).

Below are a list of the initial errors I'm getting. As I am a complete C++ newbie, I'd be very grateful if anyone could give some hints as to what is going on and how to fix it.

-----------------------

#error DCMTK needs stringstream or strstream type

(this is actually a header-generated message - I added an include for /usr/include/gcc/darwin/3.3/c++/backward/strstream but this does not abolish the above message. What is the correct way to include str{ing}stream?)

------------------------

error: parse error before `:' token

(it seems to be balking at the C++ class declaration: class OFConditionString: public OFConditionBase )

------------------------

warning: ISO C++ forbids declaration of `OFConditionString' with no type

(from these lines of code:

/// copy constructor
OFConditionString(const OFConditionString& arg)
: OFConditionBase(arg) // THIS GENERATES THE WARNING
, theCodeAndModule(arg.theCodeAndModule)
, theStatus(arg.theStatus)
, theText(arg.theText)
{
}

)

------------------------

error: only constructors take base initializers

(from this code:

/// copy constructor
OFConditionString(const OFConditionString& arg)
: OFConditionBase(arg) // THIS GENERATES THE ERROR
, theCodeAndModule(arg.theCodeAndModule)
, theStatus(arg.theStatus)
, theText(arg.theText)
{
}

)

------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Objective-C++ newbie questions
      • From: Clark Cox <email@hidden>
  • Prev by Date: Scrollview sizing/positioning questions
  • Next by Date: Re: Objective-C++ newbie questions
  • Previous by thread: Re: Scrollview sizing/positioning questions
  • Next by thread: Re: Objective-C++ newbie questions
  • Index(es):
    • Date
    • Thread