• 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
Re: Objective-C++ newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C++ newbie questions


  • Subject: Re: Objective-C++ newbie questions
  • From: Glen Low <email@hidden>
  • Date: Thu, 3 Jun 2004 08:38:52 +0800

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.

In Standard C++ usage, don't use #include <iostream.h>, use #include <iostream> (and similarly for all C++ system headers).

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?)

#include <sstream>

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

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)
{
}

)

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

Sounds like it can't find the class OFConditionString, since the above is a constructor definition not a class definition.


Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
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.


  • Prev by Date: Re: HTML to NSString
  • Next by Date: Getting keyboard events first
  • Previous by thread: Re: Objective-C++ newbie questions
  • Next by thread: Password!!!!
  • Index(es):
    • Date
    • Thread