• 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
Possible to use STL in Cocoa App?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible to use STL in Cocoa App?


  • Subject: Possible to use STL in Cocoa App?
  • From: Tony Gray <email@hidden>
  • Date: Sat, 06 Apr 2002 14:10:02 +1000

Hi,

I'm porting an old Codewarrior 5 C++ (Classic) application to MacOS X. This
application uses a minimum of UI, so I'm prepared to rewrite that using
Cocoa features, but I must leave the basic STL code alone (it's specifically
there to demonstrate STL to students).

With the following code

#include <list>

...

for_each(shapeList.begin(), shapeList.end(),
mem_fun(&genericShape::draw));


I was getting two compilation errors:

implicit declaration of function 'int mem_fun(...)'
implicit declaration of function 'int for_each(...)'

I guessed that the compiler was using the Cocoa list "list" header file, so
I added

/usr/include/gcc/darwin/2.95.2/g++/

to the headers search path in the target's build settings. Despite this, I
still get the same compilation errors.

I've even explicitly listed the #include as:

#include "/usr/include/gcc/darwin/2.95.2/g++/list"

but the compile errors are still there. How to I force Project Builder to
use the STL headers for this project? Or is it not possible to use STL
within a Cocoa app?
_______________________________________________
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: Possible to use STL in Cocoa App? - SOLVED
      • From: Tony Gray <email@hidden>
  • Prev by Date: How to make links clickable in an NSTextView
  • Next by Date: Re: Dynamic Languages [was: Re: why Obj-C]
  • Previous by thread: Re: How to make links clickable in an NSTextView
  • Next by thread: Re: Possible to use STL in Cocoa App? - SOLVED
  • Index(es):
    • Date
    • Thread