cpp/core/src/zxing/common/Counted.h:26:20: error: iostream: No such file or directory

795 views
Skip to first unread message

Denis

unread,
Sep 28, 2010, 10:26:08 AM9/28/10
to zxing
in my iPhone progect i get that problem: cpp/core/src/zxing/common/
Counted.h:26:20: error: iostream: No such file or directory
zxing-1.6/cpp/core/src/zxing/common/Counted.h:32: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'zxing'
zxing-1.6/cpp/core/src/zxing/Result.h:24:18: error: vector: No such
file or directory
how fix that problem, I think that conflict with xcode and c++

Steven Parkes

unread,
Sep 28, 2010, 10:55:55 AM9/28/10
to zx...@googlegroups.com
Objective C sources that include C++ have to have the suffix ".mm" instead of ".m" so that C++ features are enabled.

Steven Parkes

unread,
Sep 28, 2010, 11:02:25 AM9/28/10
to zx...@googlegroups.com
And to head off another question: the file that contains the main() for your app (usually main.m) needs to be a .mm (e.g., rename main.m to main.mm) to get xcode to link against the C++ standard library.

On Sep 28, 2010, at 7:26 AM, Denis wrote:

Denis

unread,
Sep 28, 2010, 11:09:18 AM9/28/10
to zxing

Steven Parkes

unread,
Sep 28, 2010, 11:19:30 AM9/28/10
to zx...@googlegroups.com
You may need to make any ObjC file that includes a C++ header into a .mm, which may be your own ObjC files. I don't exactly remember what it includes what.

Other than that, I'm not sure. It's a problem in your project setup. You can look at ScanTest for correct setup. It builds correctly.

Denis

unread,
Sep 28, 2010, 11:21:31 AM9/28/10
to zxing
I know in my project main was suffix is".mm" but i get same errors
that is my main:
int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"myproject");
[pool release];
return retVal;

Denis

unread,
Sep 28, 2010, 12:39:59 PM9/28/10
to zxing
Hyh, i fix that proble, thanks Steven Parkes,my mistake was that I
try import QRCodeReader.h in myproject.pch, when I transferred it to
the main all works))))
Thanks again for help
Reply all
Reply to author
Forward
0 new messages