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

Author Topic: Is this the correct way to build SFML and Code::Blocks with CMake?  (Read 3401 times)

0 Members and 1 Guest are viewing this topic.

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Please tell whether this is correct or not
Add a mingw/bin to environment variables.
open c-make gui and select Mingw makefiles
3)keep default native compilers enable and other field left alone.
4)building sfml -> open cmd ->> and type mingw32-make and add it to path
5)then target clean and install
6)now, create an empty project./console/or gui
7)now go to search directories->compiler=include and linker=lib. then
8)linker settings
debug and release
in the order sfml-graphics
sfml-window
sfml-system
-d for debug.
then
9)go to sfml and #defines and SFML_STATIC
then
10)Copy all dlls to the project folder
OR;
if you don't want to build sfml yourself
1)Download SFML and Codeblocks accordingly.
2)Then go to codeblocks and do set up like; search directories, linker....etc except static_sfml
3)Copy all dlls to folder where you are going to compile your executable file
Are these process correct?
------------------------------------
PS:I have seen a lot of tutorials, videos. etc etc; and even your tutorial. I even read your book about SFML and ended up to know that go online for it. >:(
My suggestion(I know software engineers will never take junior's advice) when you put your lot of efforts and your intelligence for making a software; and when you know that your current tutorial to set up codeblocks and sfml; is honestly helping none; why don't you go and try to create a straightforward tutorial for beginners, I know it is not your duty to make game programming easy to us; but come on engineer, when you have put your night and day; your weekend and holiday into making that software; why do you bother making a simplistic tutorial(although you have created a brief tutorial and I appreciate that) that will help beginner like us.
And, when people are saying that I didn't get what you did, you are saying that you have made a tutorial on that. It is the most Bullshit software documentation(for me) and for many(because many beginners are going to use this). I know I shouldn't say to someone like this. And I am sure, you will never create a simple  video on this because you have everything; money etc from this software(I don't know much!).
My conclusion is; rather than saying to everyone;wasting your 1 minute typing the shit that go and visit the sfml-dev tutorials,if you really wanted to be helpful could generate a EASY TO UNDERSTAND, step by step guide for this. Yes, that tutorial may be very easy for you because you are a great programmer, but not all people are same; BUT they dream of making games; and don't let their dreams vanished.
. If many people were helped, 10% of them would create a video and say that it is done by doing this. But, although few people are teaching about this, they are teaching it in a wrong way, or atleast I got errors when I followed that tutorials.

Why I am writing this, is because I am frustrated with your software. But, it is not that I have never been to library before! I have used allegro before and it setted up pretty much quickly and easily. But, later redditians told me not to use allegro and to use SFML and I came to this SFML. I have been trying for a week to set up your software; now I can even recite them in night, but also it has not been configured, I don't know if your software is error free or not(many people are getting different results when doing the same things;check youtube videos comments)
You may ban me, take me out; but at least you will read this; you may not want to reply this shit; but you will feel this forever.
Yours faithfully,
sciarya,
trying to set up your software for a week;

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #1 on: November 15, 2018, 08:35:37 pm »
No, that's not correct. You still need to understand the difference between building SFML and building your application which uses SFML.
The "Compiling SFML with CMake" tutorial talks about how you build SFML. The "SFML and Code::Blocks (MinGW)" tutorial talks about using SFML with Code::Blocks. Those are two different things and should not be mixed.

When you build SFML, you don't add anything manually, you just generate a project or make file and then build SFML. Alternatively you can also download the existing SFML binaries from the download page if you use the compiler that comes with Code::Blocks.

When you want to use SFML with your project, you need to adjust the project settings and add SFML. As mentioned in the tutorial you need SFML_STATIC when linking SFML static. When you do want to link SFML statically, you need to specify the SFML libraries with the -s suffix - as mentioned in the tutorial - and since it's now linked statically, you don't need to copy any SFML DLLs, you only need to copy the OpenGL32.dll if you're using the audio module.


What you're missing is, that the tutorial is easy to understand, even for people who have never programmed with C++. Want to know how I know this? Because there have been hundred of people who've managed fine with it. Plus, as you said, you've also watched a bunch of other video tutorials, read the book and the official tutorial, yet you still don't manage to get it working. If all of these many resources combined can't help you understand how to use Code::Blocks - which isn't even anything SFML specific - then I highly doubt, any tutorial, will really help you.

Engineering is about problem solving. You have problem X and you want to get solution Y. Setting up Code::Blocks is a problem, the tutorial explains you exactly what to do, if only you read and understood it fully, so you can get to the wanted solution of building SFML. If you really want to be an engineer, then you should be able to identify the current issue you have and ask for help specifically about that, instead of blaming everyone else that they aren't hand-holding you through every step.

Additionally, you shouldn't be afraid to try something. When a popup comes up, asking you to do something, then understand what it says and make a choice, see what happens and if was the wrong choice, just do it again. You don't learn if you don't try and never fail. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #2 on: November 16, 2018, 12:58:05 pm »
"What you're missing is, that the tutorial is easy to understand, even for people who have never programmed with C++. Want to know how I know this? Because there have been hundred of people who've managed fine with it. "
#lol you have seen 100 people whose did worked;
and I have seen millions; whose didn't work.




https://www.youtube.com/results?search_query=sfml+with+codeblocks
I know that it is easy. but, it simply don't works.
my questions.
1)If I follow those tutorials, are you sure that I will get no errors and program will compile easily?
2)If you had to make that tutorial in step by step form; how will you do that?
3)Does this setting varies in various computer. I followed a same youtube tutorial and got different  output than that of the youtube video. LOL

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #3 on: November 16, 2018, 12:59:43 pm »
currently I am getting errors like "cannot find -lsfml-window-s-d. "
how to solve this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #4 on: November 16, 2018, 01:20:04 pm »
I may be wrong (and I apology if I am), but I honestly think that you have no idea about what you do. You seem to just copy and paste stuff into boxes, click where you're told to, and then pray that it works. That's not how developing works.

The first thing to do in your case, would be to stop trying everything you can find on the internet, and instead try to (really) understand every step of this very simple process. That's not about SFML, that's about your ability to configure any C++ project.

So, I'll try to help you in the most meaningful way in my opinion: by making you think and understand things by yourself.

Quote
currently I am getting errors like "cannot find -lsfml-window-s-d. "
So what do you think it means? What is "-lsfml-window-s-d", and why would Code::Blocks fail to find it? What are the possible causes?
Laurent Gomila - SFML developer

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #5 on: November 16, 2018, 02:34:16 pm »
from my experience of installing this for 7 days; i think that -lsfml-window-s-d means static version of sfml used  in Debug version(not Release because release don't have suffix -d)
that means; the codeblocks is not able to find the debug static library.
It's possible causes may be-:
1) I followed a shitty youtube tutorial; which told me to uncheck debug while Create a new Project->Empty->Debug(uncheck) release(checked)
2) probably there is no library in debug(static one)

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #6 on: November 16, 2018, 02:40:12 pm »
Or you didn't follow a very simple tutorial that is here: SFML and Code::Blocks
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

sciarya

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #7 on: November 16, 2018, 03:21:24 pm »
Oh my god! i have finally done it....i am still not 100%. but I think I have solved the issue now.
but; does sfml requires some graphic card or sth extra? it is not showing circle in my computer, instead it is being hang!
how to see a circle? it is being hang on my pc...please help
But; it is still not working in my laptop. it is showing the same types of errors like -lsfml etc etc

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #8 on: November 16, 2018, 03:42:11 pm »
Quote
from my experience of installing this for 7 days; i think that -lsfml-window-s-d means static version of sfml used  in Debug version(not Release because release don't have suffix -d)
that means; the codeblocks is not able to find the debug static library.
Correct. So it looks for a library file named "libsfml-window-s-d.a", and can't find it.

Quote
It's possible causes may be-:
1) I followed a shitty youtube tutorial; which told me to uncheck debug while Create a new Project->Empty->Debug(uncheck) release(checked)
2) probably there is no library in debug(static one)
1) youtube tutorials are always shitty don't waste your time with those...
2) is ok, but the most common cause is 3) that you didn't tell the linker where to search for that file. It's the right part of this image of the tutorial:


So: check that you correctly wrote this path there, and that the file actually exists in that path in your file system.

You see, it's not hard: these steps just consists of specifying the name of the library(ies) to link, and the path where to find them. Which is, by the way, exactly what the tutorial says.
Laurent Gomila - SFML developer

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: Is this the correct way to build SFML and Code::Blocks with CMake?
« Reply #9 on: November 19, 2018, 02:33:12 pm »
how to see a circle? it is being hang on my pc...please help
If it hangs, it's most likely due to the fact your notre processing the events. You need to handle the events (see red box).
GitHub
Code Concept
Twitter
Rosme on IRC/Discord