1

Is there a way to use the HockeySDK within a Qt application? I made a basic test trying to import your framework into my project adding these lines to my profile:

# test.pro
LIBS += -F/Applications/HockeyApp.app/Contents/Frameworks -framework HockeySDK
OBJECTIVE_SOURCES += hockey.m

With the following code:

// hockey.m
#include <HockeySDK/HockeySDK.h>

void hockey() {
    [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"];
    // Do some additional configuration if needed here
    [[BITHockeyManager sharedHockeyManager] startManager];
}

But I have the following error:

error: 'HockeySDK/HockeySDK.h' file not found

Any help?

Martin Delille
  • 11,360
  • 15
  • 65
  • 132
  • Try to create a project with "HockeySDK" but without Qt. Or read the manuals, how to configure this SDK. Your problem is not related to Qt. – Dmitry Sazonov Feb 04 '16 at 11:14
  • When adding the framework to my XCode project and the code (following the manual), it compiles fine. For Qt, I'm using Qt Creator. – Martin Delille Feb 04 '16 at 11:25
  • I manage compile my project by 1) moving *.h files in HockeySDK.framework/Headers to a HockeySDK folder accessible by the include path 2) renaming the binary *HockeySDK* to *libhockey.a* – Martin Delille Feb 04 '16 at 15:51
  • I found a simpler solution adding QMAKE_CXXFLAGS += -F/Library/Frameworks QMAKE_OBJECTIVE_CFLAGS += -F/Library/Frameworks – Martin Delille Feb 04 '16 at 18:08

1 Answers1

3

I fixed my problem using the following pro file:

# test.pro
QMAKE_CXXFLAGS += -F/path/to/the/folder/containing/frameworks
QMAKE_OBJECTIVE_CFLAGS += -F/path/to/the/folder/containing/frameworks
LIBS += -F/path/to/the/folder/containing/frameworks
LIBS += -framework HockeySDK
LIBS += -framework Foundation

OBJECTIVE_SOURCES += hockey.m
Martin Delille
  • 11,360
  • 15
  • 65
  • 132