I am new to Xcode subprojects. In my iPhone app project MyProject
, I am trying to refactor some common code to a static library project called MyLibrary
. After I create MyLibrary
and move the code, MyProject
is no-longer compiling. The error is that the MyProject
cannot see the .h files in MyLibrary
.
The error MyLibraryConfig.h: No such file or directory
is coming in the line:
#import "MyLibraryConfig.h"
MyLibrary
.h files in MyProject
?To create a new file, choose File/New/File … which will open a template chooser in which you can select a header file, a C file, or a C++ file. If you select a C or C++ file, it will give you the option of also creating a header file with the same name.
I include them in the project by right-clicking on the project folder in the project view in Xcode, and selecting "Add Files to ...". I then navigate to the folder containing the source files, click on the folder and select "Add." With the options "Create folder references" and "Add to target [target name]".
h, which is called the header file. The implementation section goes into MyClass. m, which is called the implementation file. The separation into two files is not inconvenient, because Xcode, expecting you to follow this convention, makes it easy to jump from editing a . h file to the corresponding .
In build settings --> Header Search Path --> Add below entry
$(SRCROOT) and mark it as recursive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With