I have an existing iPhone application, and I just wanted to make a static library out of the code, so that I can use it by a separate test application (within the workspace). The application compiles fine, but when I try to compile the library version (which has the same code files) I get the following error:
- Lexical or Preprocessor Issue – “MyClass.h” file not found
However, the application still runs, even through there is this error. In fact when I compile the application (which uses the static library) it initially says no errors, and then after a second or two the above mention error then appears.
I’m basically doing:
- Create a new target in the project using the Coco Touch Static Library
- Add the .m files in the targets “Compile Sources”
- Adding the .h files in the targets “Copy Headers”
- Adding the same set of libraries in the “Link binaries with libraries”
- Go into the Profile and modified the Target to be RELEASE
Any suggestions? Am I missing a step here?
So, the issue turned out to be I had “-ObjC” set in the “Other Link Flags” option, which I’d put there as at one stage trying to get things working I read this was required – Dereks advice to review the compilation log worked well here