9

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?

jrturton
  • 118,105
  • 32
  • 252
  • 268
Excalibur
  • 325
  • 2
  • 5
  • 15
  • 23
    You've asked 14 questions so far and have accepted none of them. You probably should accept answers that help you, that is, if you want to motivate people to actually do the helping. – Michael Dautermann Nov 16 '11 at 15:29

2 Answers2

47

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.

smparkes
  • 13,807
  • 4
  • 36
  • 61
  • Dear,smparkes Thanks very much for your help This is included in c++ file. and also I use *.mm file . But, I always see error message "iostream not found". I think that I set the build settings wrongly . So, would you check this for me? very thanks again – Excalibur Nov 17 '11 at 01:39
  • 2
    No idea, if you're only including the header in a .mm or .cc file. You can cut and paste the whole verbose compiler errors (right click on error >> reveal in log) into a pastie (http://pastie.org/) or put it all here and we might be able to help more. – smparkes Nov 17 '11 at 01:50
  • Dear,smparkes If possible, can you show my screen via teamviewer? I will share my screen. very sorry and thanks again – Excalibur Nov 17 '11 at 07:10
  • @smparkes: Please check this link of pastie: http://pastie.org/2932154 I am getting same error as BoyGeneral and Pastie contains my Error Log – Parth Bhatt Nov 28 '11 at 08:58
  • @smparkes: I have even tried putting #include "iostream" but even that did not help. – Parth Bhatt Nov 28 '11 at 09:34
  • 4
    @ParthBhatt: Your issue is exactly as I mentioned in my answer: you're trying to include zxing into an Objective C (.m) file. Rename your file to RNAppDelegate.mm and it should work fine. – smparkes Nov 28 '11 at 13:20
1

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.