0

I'm working on a small C++ library in Xcode and would like to normalize my file includes. As it currently stands, my #includes are taking the shape of #include "Exchange.hpp", but would like to be able to use the #include <Ludere/Exchange.hpp> syntax in case I end up restructuring the project (Ludere is the project name).

I've been messing around with the build settings and have tried adding $(SRCROOT) to the search header paths but have yet to find a solution. We use this header syntax in Xcode at work but haven't found a way to set this up on my own project.

It might be useful to mention I'm developing this library, so the include directives would be used in library internal files.

RElliott
  • 93
  • 1
  • 8
  • Does this answer your question? [Include header file in Xcode c++ project](https://stackoverflow.com/questions/11772980/include-header-file-in-xcode-c-project) or [Xcode add header search path](https://developer.apple.com/forums/thread/106887) or [Adding system header search path to Xcode](https://stackoverflow.com/questions/3428216/adding-system-header-search-path-to-xcode) – brc-dd Jul 11 '20 at 16:45
  • @brc-dd Not really, I had already visited those pages and didn't have any luck, I appreciate it though. I've edited the post for some more information on my situation. – RElliott Jul 11 '20 at 18:57
  • 1
    you certainly cannot use it like `#include ` unless you put your library headers into LLVM's pre-configured `include` path, instead you'll have to use `#include "Ludere/Exchange.hpp"`. Have you tried doing this and building your project? [What is the difference between #include and #include “filename”?](https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) – brc-dd Jul 11 '20 at 19:10
  • 1
    I know Xcode default settings are set such that angle brackets are only used for system headers, but I thought there was a way to use them with a personal library. Regardless, I've decided it's not best practice, in terms of writing a library, to use angled bracket includes. Thanks so much for your insight! – RElliott Jul 11 '20 at 19:24

0 Answers0