Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"iostream" file not found in Xcode 4.2

Tags:

iphone

zxing

I'm adding Zxing 1.7(Qr scanner) to my projects.

I upgraded Mac OS X to Lion and xcode4.2, iOS5.0.

Problem is that when I run the project, I always saw "iostream file not found".

I run the scanTest(Qr scanner test sample code prvided from Zxing team) ,but it works well.

So, I compare my projects and scanTest, but I can't find any difference.

What can I do to solve this problem?

like image 753
Excalibur Avatar asked Nov 16 '11 15:11

Excalibur


2 Answers

You can only include iostream in C++ or ObjectiveC++ files. If your case is the latter, the file suffix needs to be .mm. So, for example, if your controller class imports QRCodeReader.h and is named MyController.m, it should be renamed MyController.mMyController.mm.

like image 52
smparkes Avatar answered Nov 01 '22 02:11

smparkes


Yes Right. This post helps me in understanding this concept a lot.

We make error when we are importing QRCodeReader.h into .m file of the project. Instead of this change the extension of the file to .mm file. it will include iostream file in the counted.h file of your project. thanks guys.

like image 1
Pankaj Chauhan Avatar answered Nov 01 '22 03:11

Pankaj Chauhan