Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Building SFML from repository using QT creator IDE  (Read 7737 times)

0 Members and 1 Guest are viewing this topic.

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Building SFML from repository using QT creator IDE
« on: October 30, 2012, 05:47:14 pm »
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!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10999
    • View Profile
    • development blog
    • Email
AW: Building SFML from repository using QT creator IDE
« Reply #1 on: October 30, 2012, 06:26:06 pm »
In the official wiki tutorial section on GitHub. ;)
Also take a look at the rules there.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #2 on: October 30, 2012, 07:01:27 pm »
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10999
    • View Profile
    • development blog
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #3 on: October 30, 2012, 09:11:10 pm »
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). ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #4 on: October 30, 2012, 11:31:06 pm »
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10999
    • View Profile
    • development blog
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #5 on: October 31, 2012, 12:34:48 am »
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

It's nearly untouched but probably could use some polishing, so feel free to do so. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #6 on: October 31, 2012, 08:02:14 am »
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.
Laurent Gomila - SFML developer

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #7 on: October 31, 2012, 11:42:47 am »
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...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #8 on: October 31, 2012, 11:49:52 am »
Quote
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
Laurent Gomila - SFML developer

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #9 on: October 31, 2012, 11:54:56 am »
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #10 on: October 31, 2012, 12:23:04 pm »
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).
Laurent Gomila - SFML developer

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #11 on: October 31, 2012, 01:13:50 pm »
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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #12 on: October 31, 2012, 01:32:37 pm »
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 ...
 
Laurent Gomila - SFML developer

toulis9999

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Building SFML from repository using QT creator IDE
« Reply #13 on: October 31, 2012, 02:29:52 pm »
Done. Thanks again for your help.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Building SFML from repository using QT creator IDE
« Reply #14 on: October 31, 2012, 02:36:39 pm »
By the way, the order of libraries is wrong: since sfml-window depends on sfml-system, it should be written before.
Laurent Gomila - SFML developer