Iostream not found in Xcode

I have a problem including ZXing in my application. I get an error: "The iostream file was not found." I did everything as in the ZXing instruction, but I cannot get this to work. I am including this in a .mm file. I use bulletin boards, this project is for iOS 6.0. This is the error I get:

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

Any idea what I can do to get this to work?

EDIT:

When I select “Compile the source file as compilation of the Objcetive-C ++ project without problems”, but, as I was told, this does not mean that this may be the cause of the divine soul, it may cause some problems later with other parts of the application.

+6
source share
4 answers

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

+10
source

Project → Build Settings → Apple LLVM 4.1 Compiler-Language → C ++ Standard Library

Be sure to set this parameter to libstdc ++ "

+6
source

Try creating a new project and select the "command line tool" as a template for your project. Choose C ++. Paste your code into a new project (this should be a .cpp file). When you run the program, it should be able to enable iostream without any problems.

+2
source

placing #import "QRCodeReader.h" in mm file instead the header file fixed the problem for me

0
source

All Articles