Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'iostream' file not found error occur in xcode 4.5?

i m practising C++. i just add c++ files in XCode and write some string splitting functionality in it. After that i include that C++ file i.e. extension of .mm file in my AppDelegate file and call function from .h file of C++ class. But i found one static error in red line which is 'iostream' file not found . I used latest XCode version 4.5 and iOS 6.0. Please see screen shot of my error or xcode screen. enter image description here

I m tried to modify my code as per given link information but no success. :(

also i followed this link information as well, but result is same.

Thanks iHungry

like image 624
Tirth Avatar asked Jan 17 '13 10:01

Tirth


1 Answers

Objective C having .m extensions for its implementation files. If you want to use C++ in Objective C it should have .mm extensions. you can include C++ header files in your .mm file. But if you want to include your C++ header files in your .h file, you need to check macro for that, like

#ifdef __cplus
#include <iostream>
#endif

But, I haven't tried any functions by including C++ header file in .h file. Hope it helps.

like image 124
arthankamal Avatar answered Sep 23 '22 04:09

arthankamal