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

Re: Possible to use STL in Cocoa App? - SOLVED


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

Sorry people,

I solved my problem (below). It seems CodeWarrior was automatically
including more of STL through the #include <list> than Project Builder was.
I had to also #include <algorithm> and <functional>, and now all works.



> 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.
_______________________________________________
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.

References: 
 >Possible to use STL in Cocoa App? (From: Tony Gray <email@hidden>)

  • Prev by Date: Re: Dynamic Languages [was: Re: why Obj-C]
  • Next by Date: Re: Dynamic Languages [was: Re: why Obj-C]
  • Previous by thread: Possible to use STL in Cocoa App?
  • Next by thread: Possible to use STL in Cocoa App?
  • Index(es):
    • Date
    • Thread