-
Hi everyone,
This is my first post although I've been following the library for quite some time now.
To the point:
Recently I have uninstalled VS2010 in order to upgrade to VS2012 and I have successfully built the library for it.
This however broke my interchangeability with the QT creator IDE which I use to integrate SFML for a Level editor that I am building.
Through trial and error I managed to build the library using QT creator's MingGW integrated compiler using its ability to communicate with Cmake.
I would like to post a step by step tutorial of the process if anyone is interested and I am asking where is the correct place to make such a post?
Thanks in advance and congratulations for making such an awesome library!
-
In the official wiki tutorial section on GitHub. ;)
Also take a look at the rules there.
-
Thanks for the answer but wow! this seems quite complicated for me!
What I could really easily do is, make a word/rtf document explaining the tutorial and share it with anyone willing to upload it on Github...
I have started as we speak.
-
this seems quite complicated for me!
With what do you have problem with? I mean you only need to make a GitHub account and you're ready to enter it with many different formatting options. Sure it needs a bit more effort than just copy&pasting it to some text box, but com'on... ;)
What I could really easily do is, make a word/rtf document explaining the tutorial and share it with anyone willing to upload it on Github...
Sure I'll add it there. You can either post a link the file here or send it per email (eXpl0it3r@my-gate.net). ;)
-
Thanks a lot exploiter. I have sent you the tutorial in pdf format. Thank you in advance for your effort to post it on Github and I hope many people will benefit from it.
-
Thanks a lot exploiter. I have sent you the tutorial in pdf format. Thank you in advance for your effort to post it on Github and I hope many people will benefit from it.
So here you go with the wiki entry: Tutorial: Compile and Link SFML with Qt Creator (https://github.com/SFML/SFML/wiki/Tutorial:-Compile-and-Link-SFML-with-Qt-Creator)
It's nearly untouched but probably could use some polishing, so feel free to do so. :D
-
You're not supposed to edit the CMakeCache.txt file, you must instead pass your CMake arguments when you call it from the GUI (-DCMAKE_BUILD_TYPE=Debug).
And instead of giving all libraries with an absolute path, you should rather do this:
LIBS += -LC:\SFML\qtcreator-build\lib
LIBS += -lsfml-audio-d
etc.
-
There you go :D
I was 100% sure there was a less hackish way to do things!
Since you seem to know your way to Qt creator, may I ask how are you supposed to instruct the project what libraries to use depending on release/debug builds?
changing the wiki as we speak...
-
how are you supposed to instruct the project what libraries to use depending on release/debug builds?
Isn't it what do you here?
win32:CONFIG(release, debug|release): LIBS += C:\SFML\qtcreator-build\lib\libsfml-audio.a
else:win32:CONFIG(debug, debug|release): LIBS += C:\SFML\qtcreator-build\lib\libsfml-audio-d.a
-
Yup, this is actually a modified output of the automatic generation provided by Qt creator when linking libraries and I guess it only works for windows. I guess I have to research a more general way to do it and include it on the wiki.
-
You can remove the win32: prefix if you don't want to filter by OS. The search path will most likely be specific to each OS, but the linked library will be the same (except maybe for OS X).
-
Your tips guided me to the right direction!
I have figured out that is far more simpler to separate the debug and release libs to separate folders and link them in a single line as you previously shown.
Changing the wiki to reflect that...
Thanks for the help Laurent
-
You can make it even shorter:
LIBS += -LC:\SFML\qtcreator-build\lib
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network ...
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-network-d ...
-
Done. Thanks again for your help.
-
By the way, the order of libraries is wrong: since sfml-window depends on sfml-system, it should be written before.
-
I've changed the order of linking (even tough I think the order would not matter in a sense..)
The main Issue I try to figure out is why the compiler/debugger/IDE does not complain about missing dll's (provided they are not in the \system32 folder to begin with) a la Visual Studio and happily executes without showing anything on screen.
I am by no means an expert but it seems to me that I am missing something.
-
even tough I think the order would not matter in a sense..
It does, with gcc.
The main Issue I try to figure out is why the compiler/debugger/IDE does not complain about missing dll's (provided they are not in the \system32 folder to begin with) a la Visual Studio and happily executes without showing anything on screen.
What does "happily executes without showing anything on screen" mean? The application runs but shows no window? Or a window but nothing drawn inside? Or runs and ends immediately?
What happens if you run the executable from the Windows explorer directly?
-
The application runs but no window is shown.
When I run the executable from the explorer, then it complains about dlls.
-
Check the application console (in QtCreator), the error messages may appear here instead of in a popup window.
-
A fresh project I created now executes properly from the IDE itself even without having the dlls in the .exe folder.
Sidenote: I am not overly familiar with Qt IDE. Since the process in the tutorial works I will leave it as it is for now.
If I come across any shortcomings during the development of my application, I will make sure to post again and modify the tutorial to reflect any changes.