iostream not found in Xcode

Adam Szeptycki picture Adam Szeptycki · Dec 13, 2012 · Viewed 29.9k times · Source

I have problem including ZXing in my App. I get error: "iostream file not found". I have done everything like in ZXing instruction but i can't get this working. I'm including this in .mm file. I use story boards this project is for iOS 6.0 This is error i get:

In file included from /Users/adam/Developer/project/project/SecondViewController.mm:11: In file included from zxing/iphone/ZXingWidget/Classes/QRCodeReader.h:10: In file included from zxing/iphone/ZXingWidget/Classes/FormatReader.h:22: zxing/cpp/core/src/zxing/common/Counted.h:23:10: fatal error: 'iostream' file not found

Any idea what can i do to get this working?

EDIT:

When i select Compile Source File As Objcetive-C++ project comiples without issues, BUT as i was told this is not god soultion beacuse this can make some problems later on with other parts of app.

Answer

Spawnrider picture Spawnrider · Apr 29, 2013

Just rename your implementation file with .mm extension instead of .m solve the issue.