Reputation: 2074
I have file .h with many includes and other stuff. How to add it to Xcode so I'd be able to use it in any C++ console program project just by writing #include "headername.h"
?
Upvotes: 0
Views: 4001
Reputation: 4891
Assuming the "other stuff" is a library or libraries, you will need to add them to the library search paths and tell Xcode to link your console programs with them. You will also need to add the header location to the header search paths. Here are the steps:
You should now be able to include the library headers into your console project and it should be built using the library.
Now, if the "other stuff" is a bunch of C and C++ files, then you will need to build a library from it. You can do it on the command line, but here is how to do it in Xcode:
Your library is ready! Take a note of the location of the resulting .a library file. You can copy it to a different location if you want to. Then you can use the library as described above.
Upvotes: 3