Can't include PhotonPeer.h

Options
cckrobinson
edited August 2013 in Native
I'm using the iOS C++ SDK, and I'm having a heck of a time getting my include paths setup correctly in xCode. I've followed step 1 below (see attachment 1), but I always get a 'Photon-cpp/inc/PhotonPeer.h' file not found error when I add the #include from step 4 into my code.
1. Add the parent-folder(s) of the folders Photon-cpp/inc and Common-cpp/inc to "Header Search Paths" in category "Search Paths" in your applications Project Settings
2....
3....
4. Add the following #include directive to your source-code:
#include "Photon-cpp/inc/PhotonPeer.h"

I added the Photon-iOS_v3-2-2-0_SDK folder as a group to my project (see attachment 2). What do I need to do in xCode to get it to find the headers using the relative paths?

Comments

  • Kaiserludi
    Options
    Hi.

    Please switch from recursive to non-recursive. The "recursive" option can cause some issues.

    The main cause of your problem however probably is the $(PROJECT_NAME) path. That will only work, if next to your project file there is a sub folder with the name of your project and if that sub folder contains the Photon SDK folder like this:
    [code2=plain]- project-folder
    - $(PROJECT_NAME).xcodeproj
    - $(PROJECT_NAME)
    - Photon-iOS_v3-2-2-0_SDK
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]

    If you have a folder hierarchy like
    [code2=plain]- project-folder
    - $(PROJECT_NAME).xcodeproj
    - Photon-iOS_v3-2-2-0_SDK
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    then the header search paths entry should simply look like
    "Photon-iOS_v3-2-2-0_SDK"

    If you folder hierarchy looks like
    [code2=plain]- project-folder
    - $(PROJECT_NAME).xcodeproj
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    then the header search paths entry should simply look like
    "."

    If you folder hierarchy looks like
    [code2=plain]- project-folder
    - sub folder
    - $(PROJECT_NAME).xcodeproj
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    then the header search paths entry should simply look like
    ".."

    If you folder hierarchy looks like
    [code2=plain]- project-folder
    - sub folder
    - sub folder
    - $(PROJECT_NAME).xcodeproj
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    then the header search paths entry should simply look like
    "../.."

    If you folder hierarchy looks like
    [code2=plain]- project-folder
    - sub folder
    - sub folder
    - $(PROJECT_NAME).xcodeproj
    - Photon-iOS_v3-2-2-0_SDK
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    then the header search paths entry should simply look like
    "../../Photon-iOS_v3-2-2-0_SDK"

    and so on.
  • Thanks. I updated my directory structure to look like this:

    [code2=plain]- project-folder
    - $(PROJECT_NAME).xcodeproj
    - Photon-iOS_v3-2-2-0_SDK
    - Common-cpp
    - Photon-cpp
    - LoadBalancing-cpp[/code2]
    I was able to make it work, but to do so I needed to add "Photon-iOS_v3-2-2-0_SDK" to the User Header Search Paths. It didn't work if I added it to the Header Search Paths. I don't understand why, but the code now compiles using the relative include path for PhotonPeer.h.

    Thanks for your help.
  • Kaiserludi
    Options
    The comment under http://stackoverflow.com/a/16431884/404734 gives some more info on this.
    However I have no idea, why it doesn't work with the header search paths in your case, as they should also be used, if an include could not be found in the user header search paths.
    Well, great that it works now :-)