0

I am building an iPhone app using ZXingWidget. I followed the README instructions and got everything setup in my project and it compiled with no problem. I then imported QRCodeReader.h in my view controller header file and started to get the following error on compilation of FormatReader.h:

Lexical or Preprocessor issue 'zxing/common/Counted.h' file not found.

I realized I had forgotten to rename my view controller implementation file from .m to .mm so I did that. However, I am still getting the error.

Any suggestions?

EDIT: Here is the directory layout for my "QR Scan" project. You will see that "cpp" is under the "Projects" folder and that "QR Scan.xcodeproj" is in the "QR Scan" folder. I have "../cpp/core/src" in my headers for my QR Scan Xcode project.

 /Projects
      /cpp
           /core
                /src
      /QR Scan
           /QR Scan
           /ZXingWidget
                ZXingWidget.xcodeproj
           QR Scan.xcodeproj
Shane Kenny
  • 28
  • 1
  • 4

2 Answers2

5

Double check step 5 of the README. You don't have the C++ header files in your include path.

smparkes
  • 13,807
  • 4
  • 36
  • 61
  • I added the folder structure for my project to my main post for you to look at. Maybe I am just staring at the obvious, but it seems like "../cpp/core/src" is the right path to have in my headers for the project. I also tried including the absolute path to "ccp/core/src" rather than relative path and that did not help. – Shane Kenny Apr 21 '12 at 12:36
  • What you've said sounds pretty right so it's hard to say which bit is messing up. I would look at the compile command that Xcode is generating and look at the -I in the command and see if I could figure it out from there ... – smparkes Apr 21 '12 at 15:04
  • Thanks for your help. I changed the header path to an invalid path, did a build, and then changed it back to "../cpp/core/src" and it magically started working. You gotta love those errors that you spend hours on and they just magically disappear. – Shane Kenny Apr 21 '12 at 15:29
1

I had to spend lot of time fixing this problem. Even after change the file extension to .mm, the problem still showed up. The problem was because of the import statement. Try placing the #import "ZXingWidgetController.h" in your .h (header file) and #import "QRCodeReader.h" in your .m(implementation file). This really solved my problem in XCode 4.2. hope this helps someone.