Possible to use STL in Cocoa App?
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.