Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode can't find a standard c++ include file

When i mix .m and .cpp i have a problem with xcode not finding the default cpp include (like <map>)

update: i'm adding a static lib in my iphone project (which does compile without any problems) and then use the include inside the .m, then the dependencies .h from c++ gets crazy..can't find or can't compile, i tried the .mm but it does'nt works.

like image 214
CiNN Avatar asked Jun 17 '09 15:06

CiNN


1 Answers

If you are using Objective-C++ (i.e. mixing Objective-C and C++ in one source file or importing a C++ header into an Objective-C file), then you should be using the .mm extension on your source code files. By default, Xcode will compile .mm files using the Objective-C++ compiler. .m files are compiled using the standard C compiler.

like image 179
Barry Wark Avatar answered Nov 15 '22 07:11

Barry Wark