views:

22

answers:

1

Hi

In Xcode, suppose that there is a framework named Foo. Inside the Foo.framework/Headers folder there are files File1.h and File2.h. The header file File1.h includes File2.h via the following directive:

#include <File2.h>

The Foo framework is a re-package of a C++ library not specifically targeted for the Mac.

Now suppose I have a project that links to the Foo framework. It has a file MyFile.mm that includes File1.h via the following directive:

#import <Foo/File1.h>

Now when I tried to compile MyFile.mm, it always fails because it can't find File2.h. How can I get this to compile and run without modifying the header files of the Foo framework?

For the curious, the actual framework in question is a framework-packaged version of Taglib taken from the Max source tree. The file that I tried to include was <taglib/mp4.tag> and compiling the .mm file that includes it always fail due to mp4tag.h is including <tag.h> without the <taglib/...> prefix in the include directive. The error is not only in this one header files, but there are similar issues in a large number of header files and thus modifying all of these include statements is non trivial. All of the required "missing" header files are actually present in the framework's Header subdirectory.

I'm trying to use Taglib in my app and although I was able to compile Taglib as a framework with header files and add it to my app, I can't seem to get the app to compile due to the issues above.

Anybody has any pointers?

Thanks.

+1  A: 

I think that File1.h should say:

#include "File2.h"

Try checking the "Always Search User Paths" option in Xcode.

JWWalker
The "Always Search User Paths" is checked (this is the default option). File1.h is part of the open source library and its not just one file (i.e. there are many header files that includes other header files in the library the same way).
adib
OK, at this point I'm sure that the framework is set up incorrectly. If you can't fix it, then you'll need to add a header search path to the Headers folder of the framework.
JWWalker
How can I tell whether the framework is set up correctly or not?
adib
I meant that if it's including its own headers as if they were system headers (in angle brackets), that's incorrect.
JWWalker