QT Creator with SDL (OSX, Windows)



  • Hi, I am trying to get QT creator to run in these environments to compile a simple SDL app. I have SDL installed in the correct location, and am compiling with the following .pro:

    @
    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES += main.cpp

    CONFIG -= x86_64
    CONFIG += x86
    INCLUDEPATH += /Library/Frameworks
    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
    LIBS += -framework Cocoa -framework SDL

    OBJECTIVE_SOURCES += SDLMain.m
    HEADERS += SDLMain.h
    @

    The compiler error I get is:

    @
    ld: framework not found SDL
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [sdltest] Error 1
    @

    Suggesting that the framework was not found. Any info or help would be appreciated.

    EDIT: this issue is for OSX at the moment.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You might be missing:

    @LIBS += -F/Library/Frameworks@



  • Hi, thanks for the reply. I ended up with the following:

    @
    QMAKE_LFLAGS += -F/Library/Frameworks
    @

    But both accomplish the same goal (I prefer to use yours). I checked the man page for the linker, and it says this:

    bq. The -L option will add a new library search path. The default framework search path is /Library/Frameworks then /System/Library/Frameworks. The -F option will a new framework search path. The -Z option will remove the standard search paths.

    So that explains that :). For anyone searching for this, my app entry point turned out to be:
    int SDL_main(int argc, char** argv)

    Cheers, i'll pop in if I have more problems with the windows build this afternoon.


  • Lifetime Qt Champion

    You're welcome !

    Since it's all good, don't forget to update the thread's title to solved so other forum users will know that a solution has been found :)



  • Hi, did you config SDL with qtcreator in windows?. Because I have same probleme and I want to ask you?



  • Hi, did you config SDL with qtcreator in windows?. Because I have same probleme and I want to ask you?


Log in to reply
 

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