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

Author Topic: how to select SFML version to match CodeBlocks version  (Read 7348 times)

0 Members and 1 Guest are viewing this topic.

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 10:59:42 am »
The SFML set up instructions (https://www.sfml-dev.org/tutorials/2.5/start-cb.php) stresses the importance of correct selection of SFML version to match that of CodeBlocks, but does not offer clear guidince for that.

Indeed the last thing we want is the setup will start failing on certain projects because of non-compatibility of SFML and CodBlocks versions.
 
On https://youtu.be/8aQdx40KeHw?t=45  a Russian chap sugests that the correct version of SFML should match two dll files in Program Files\CodeBlocks\MinGW\bin:

libgcc_s_dw2-1.dll
libgcc_s_sjlj-1.dll

If you have just libgcc_s_dw2-1.dll than download DW2 version
If you also have libgcc_s_sjlj-1.dll then doen load SJLJ version

Is this correct?
If it is, will also be correct to download the SEH version if I donot have libgcc_s_dw2-1.dll or libgcc_s_sjlj-1.dll, but have  libgcc_s_seh-1.dll (I have CodeBlocks version 20.03

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #1 on: November 22, 2021, 11:30:50 am »
The safest bet is to build SFML yourself. Then you know it will match perfectly and doing so, will most likely be less time required, than you having to figure out why something fails and how to get the right compiler. ;)

The download page links to the relevant compiler.
You can check the compiler version with gcc --version.

Code::Blocks 20.03 ships IIRC with the MinGW-w64 8.1.0 GCC compiler, which we don't provide binaries for on the download page, but there exists snapshot builds for said compiler: https://artifacts.sfml-dev.org/by-branch/master/

SJLJ, DW2 and SEH are different exception models and thus can't be mixed. SEH is only available for the x64 architecture, so make sure to grab the 64-bits binaries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #2 on: November 22, 2021, 11:48:01 am »
Thanks. I know that if you want something to be done correctly, do it yourself. Yet this works only when you are professional in that craft.
Do you mean that for my Win-10 64 bit and CodeBlocks 20.03 I need GCC 7.3.0 MinGW (SEH) - 64-bit ?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #3 on: November 22, 2021, 02:06:36 pm »
Not sure how you came to that conclusion from my post... :D

If you use CodeBlocks 20.03 and don't want to change your compiler, then you can get the artifacts build linked above.
If you use CodeBlocks 20.03 and want to change your compiler, then you can download the linked compiler on the download page and the matching SFML package.

If you have a compiler with SEH exception model, then you a) have a 64-bits compiler and b) you need a 64-bits package.

How you do it is up to you, all that matters is that it's compatible.

Also it doesn't take any professionalism to run CMake. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #4 on: November 22, 2021, 02:49:55 pm »
Thanks a lot for your time. Also mind that English is not my mother tongue, threfore I might mis-interpret your comments.

1. As I said, I am basing my conclusions on  instructions (https://www.sfml-dev.org/tutorials/2.5/start-cb.php)
These instructions only instruct to downlowas SFML matching CodeBlocks. It says nothing about  artifacts linked above (what exactly  are the "artifacts above"?).
 
2. The instructions say nothing about changing compiler. As a complete newby to SFML and CodeBlock I just need to make a working set up to start coding in C++; During installation I selected GNU GCC compiler and then C++; Therefore at this stage I do not know why I should consider to change compiler or not

3. "If you have a compiler with SEH exception mode" - how shall I know if I  have a compiler with or without SEH exception mode?

Before posting my question I browsed through the questions people are asking. Many questions deal with the code refused to compile of some files are not found - probably the reason for that is wrong version of SFML and wrong setup. Therefore explanation in layman terms is of importance
 


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #5 on: November 22, 2021, 03:29:18 pm »
The tutorial might not be very explicit about things and could potential do with a bit of an adjustment, on the other hand SFML is just one of many C++ libraries out there and the situation of compilers having to match exactly isn't unique to SFML. We can't possibly list all combinations of compilers and compatible packages, nor do we see it in our responsibility to teach people how to use their IDE of choice.

As most of your questions are now regarding the explanation and understanding of the tutorial, I'm unsure whether you've understood my explanations now. Does it work are you still stuck with something?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #6 on: November 22, 2021, 04:11:35 pm »
Thank you for being positive. As I said, I would like to exclude the possibility of after 10 successful projects the 11th project would fail and I'll have not only to re-install SFML, but also to correct those 10 successfull projects.

I installed CodeBlocks and successfuly  tested it on C++ Hellow Word.

I downloaded GCC 7.3.0 MinGW (DW2)-32-bit  and  SFML-2.5.1-windows-gcc-7.3.0-mingw-64-bit.zip but do not proceed with installation till I know which version to install.  Try-and-see method is the only one if you explore something unknown. But to stage experiments to learn something known to those who are in this business seems to be unreasonable. Before inventing the wheel it pays to ask if it has already been invented!

If we have just two SFML versions to select from and one version of CodeBlocks, where in the CodeBlocks I should look at to see which SFML version suits it? 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #7 on: November 22, 2021, 04:36:21 pm »
To make it simple, if you have Code::Blocks 20.03, you can download this package and it should work with the given compiler.

You can check your compiler version by calling gcc --version in a console window.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #8 on: November 22, 2021, 05:02:48 pm »
Is windows-gcc-810-mingw-64.zip a SFML version not listed on the SFML download page?
Also in which console I run  gcc --version? If you mean Windows command prompt - it returnes "Non executable"

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #9 on: November 22, 2021, 05:35:37 pm »
Yes, that version is not listed on the download page, because it was setup after the release of SFML 2.5.1

You'll have to navigate to the bin/ directory of the mingw directory, where the gcc.exe is located.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #10 on: November 22, 2021, 05:49:09 pm »
thank you. Version returened:
gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

how should I act upon this?

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #11 on: November 22, 2021, 05:51:52 pm »
does version 8.1.0 refers to 810 in the filename of SFML you refered me to?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #12 on: November 22, 2021, 05:56:41 pm »
Yes, it should work with that package
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: how to select SFML version to match CodeBlocks version
« Reply #13 on: November 22, 2021, 06:29:47 pm »
Thank you very much. Now I have solid understanding, not a guesswork!