[solved] Headers with path not found on IOS



  • I have a problem compiling my project for IOS. Everything build fine on linux and macx.

    The compiler fail to find my included headers when I specified a path for the file. For example,

    @#include "include/machine/E15_00_SYSTEME_INJECTION.h"@

    This header file will not be found. The include folder is in located inside my root project folder :

    /myproject/include

    Here is my .pro file.

    @
    TEMPLATE = app

    QT += qml quick widgets

    SOURCES +=
    src/main.cpp
    src/machine.cpp
    src/com/machineObj.cpp
    src/com/mybuslistener.cpp
    src/com/machine_com.cpp
    src/inventory.cpp
    src/alljoynbridge.cpp

    HEADERS +=
    include/machine.h
    include/com/machineObj.h
    include/com/machine_obj_message.h
    include/com/mybuslistener.h
    include/com/interface_struct.h
    include/machine/00_PF9_SI_0000.h
    include/machine/E15_SI_00_SYSTEME_INJECTION.h
    include/com/machine_com.h
    include/inventory.h
    include/machine/E15_00_SYSTEME_INJECTION.h
    include/alljoynbridge.h

    RESOURCES += resources/qml.qrc

    Additional import path used to resolve QML modules in Qt Creator's code model

    QML_IMPORT_PATH = resources/

    Linux

    unix:!mac {
    LIBS += -L/home/mathben/Downloads/alljoyn/alljoyn-suite-14.06.00-src/core/alljoyn/build/linux/x86_64/debug/dist/cpp/lib/ -lalljoyn -lstdc++ -lcrypto -lpthread -lrt -lboost_system
    }

    Mac os

    macx {
    _BOOST_PATH = /usr/local/Cellar/boost/1.56.0
    _ALLJOYN_PATH = /Users/jn/Documents/alljoyn/alljoyn-suite-14.06.00a-src/core/alljoyn/build/darwin/x86/debug/dist/cpp

    LIBS += -L$${_BOOST_PATH}/lib -lboost_system
    INCLUDEPATH += "$${_BOOST_PATH}/include/"
    DEPENDPATH += "$${_BOOST_PATH}/include/"
    
    
    LIBS += -L$${_ALLJOYN_PATH}/lib -lalljoyn -lstdc++ -lcrypto -lpthread
    INCLUDEPATH += "$${_ALLJOYN_PATH}/inc"
    DEPENDPATH += "$${_ALLJOYN_PATH}/inc"
    
    DEFINES += QCC_CPU_X86
    DEFINES += QCC_OS_GROUP_POSIX
    DEFINES += QCC_OS_DARWIN
    
    QMAKE_MAC_SDK = macosx10.10
    

    }

    IOS

    ios {
    CONFIG+=c++11

    _BOOST_PATH = /Users/jn/sources/ofxiOSBoost/libs/boost
    _ALLJOYN_PATH = /Users/jn/alljoyn-14.12.00-osx_ios-sdk
    
    LIBS += -L$${_BOOST_PATH}/ios -lboost_system
    INCLUDEPATH += "$${_BOOST_PATH}/include/boost"
    DEPENDPATH += "$${_BOOST_PATH}/include/boost"
    
    LIBS += -L$${_ALLJOYN_PATH}/build/darwin/armv7/iphoneos/debug/dist/cpp/lib -lalljoyn -lajrouter -lBundledRouter.o  -lstdc++ -lpthread
    INCLUDEPATH += "$${_ALLJOYN_PATH}/build/darwin/armv7/iphoneos/debug/dist/cpp/inc"
    INCLUDEPATH += "$${_ALLJOYN_PATH}/alljoyn_objc/AllJoynFramework/AllJoynFramework"
    DEPENDPATH += "$${_ALLJOYN_PATH}/build/darwin/armv7/iphoneos/debug/dist/cpp/inc"
    
    DEFINES += QCC_OS_GROUP_POSIX
    DEFINES += QCC_OS_DARWIN
    

    }

    Default rules for deployment.

    include(deployment.pri)

    FORMS +=

    OTHER_FILES +=
    README.md

    @

    Thank you !


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I'd use this:

    @
    INCLUDEPATH+= $$PWD/include
    @

    And avoid having "include" in the #include lines file path



  • Hi and thank you for your reply.

    Is there any way we can avoid to do this? The project needs to compile on linux, android, mac and iOS.

    We got a lot of #include lines with a path inside. This problem happens only with iOS :-( It would be a lot of work to change those include lines.

    Thank you !


  • Lifetime Qt Champion

    Then try again with:

    @INCLUDEPATH+= $$PWD@



  • Thank you that resolved the problem!


  • Lifetime Qt Champion

    You're welcome !

    Since your path are now found, please update the thread title prepending [solved] so other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.