How do I link .cpp files to .hpp files that were made outside of the project?

If you create a new .cpp file in Xcode, it will automatically create a corresponding .hpp file to link it to. Is there a way I can do this manually through the IDE with 'include' files that were not created in the project? (the reason for this being so that I don't need to rewrite the same code for each project)


A simple code example would be...

in A.hpp:


class A{ 
     void method(); 
};


and in A.cpp:


#include "A.hpp" 

void A::method(){/do stuff*/};


and in main.cpp


#include <A.hpp> 
int main(){ 
     A a; 
     a.method(); 
}
How do I link .cpp files to .hpp files that were made outside of the project?
 
 
Q