SFML2 +QtCreator + MacOSX



  • Hi,

    Im making a little tutorial about configure SFML in all systems using QtCreator IDE and i want configure now with MACOSX.

    Everything is OK when i build the project, i download the version RC for mac, extract to a path and link with my .pro and i compie with success.

    But when i will run i got error:

    [quote]dyld: Library not loaded: @executable_path/../Frameworks/libsfml-system.2.dylib
    Referenced from: /Users/paulo/Pessoal/workspaces/qt/sfml-project-build-desktop-Qt_4_8_1__gcc__Debug/sfml-project.app/Contents/MacOS/sfml-project
    Reason: image not found
    Press <RETURN> to close this window...
    [/quote]

    This is my .pro:

    [quote]TEMPLATE = app
    CONFIG += console
    CONFIG -= qt

    SOURCES += main.cpp

    INCLUDEPATH += "/Users/paulo/Pessoal/downloads/cpp/sfml/dylibs/root/usr/local/include"
    LIBS += -L"/Users/paulo/Pessoal/downloads/cpp/sfml/dylibs/root/usr/local/lib"
    -lsfml-system
    -lsfml-window
    -lsfml-graphics
    -lsfml-audio
    -lsfml-network
    [/quote]

    Example:

    My project when build, generate the path:

    /Users/paulo/Pessoal/workspaces/qt/sfml-project-build-desktop-Qt_4_8_1__gcc__Debug/sfml-project.app/Contents/MacOS/

    If i run the binary inside it, called: sfml-project , i get that error

    So what i do? I have created a new directory:

    /Users/paulo/Pessoal/workspaces/qt/sfml-project-build-desktop-Qt_4_8_1__gcc__Debug/sfml-project.app/Contents/Frameworks

    And copy all this files to it:

    SFML.framework
    libsfml-graphics.2.0.dylib
    libsfml-network.2.dylib
    libsfml-system.dylib
    sfml-audio.framework
    sfml-window.framework
    libsfml-audio.2.0.dylib
    libsfml-graphics.2.dylib
    libsfml-network.dylib
    libsfml-window.2.0.dylib
    sfml-graphics.framework
    sndfile.framework
    libsfml-audio.2.dylib
    libsfml-graphics.dylib
    libsfml-system.2.0.dylib
    libsfml-window.2.dylib
    sfml-network.framework
    libsfml-audio.dylib
    libsfml-network.2.0.dylib
    libsfml-system.2.dylib
    libsfml-window.dylib
    sfml-system.framework

    And when i run the binary, it works!

    But i need do it direct from QtCreator or link/auto-copy it to correct location.



  • Hi.

    I solve the problem. Thanks



  • Hi prsolucoes!

    [quote author="prsolucoes" date="1334990836"]Hi.

    I solve the problem. Thanks[/quote]

    Could you quickly add here how you solved it? It may be interesting for other users later.



  • I solve the problem on mac, but on windows i cant copy all DLLS, can you see the problem?

    The solution is in repository of the project.

    All is here:
    https://qt-project.org/forums/viewthread/16580/


Log in to reply
 

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