SFML community forums
Help => General => Topic started by: prchakal on April 20, 2012, 08:22:23 pm
-
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:
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...
I know that i need link the frameworks that come in the ZIP file for MAC but i dont know how to do it with mac, can anyone help me?
This is my .pro:
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
-
It's not the compilation/linking that is at fault but your installation of SFML : it cannot find libsfml-system.2.dylib.
Did you run the installer or did you follow "... with your bare hands" section of the tutorial ?
-
Hi Hiura,
Yu are correct. After post here i try found the problem and correct, and if i copy the dylib files and all frameworks to "Frameworks" path in my build, it works.
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.
-
I have no idea how QtCreator works so I won't be able to help you much. Maybe you can add a post-action shell script ?
However, you don't need to copy both dylibs and frameworks. Just choose one kind of binary. (There is more information in the tutorial about that.)
-
Hi.
I solve the problem. Thanks!
-
What is the solution? Other people might have the same question. Like me.
-
Hi sorry ,
You can get here https://github.com/prsolucoes/sfml-project
-
Thank you very much. Normally forums are frustrating in situations like this.
You are awesome.