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

Author Topic: Help with Setting up SFML 2.6 with CodeBlocks 20.03  (Read 1579 times)

0 Members and 1 Guest are viewing this topic.

Frank Scrooby

  • Newbie
  • *
  • Posts: 2
    • View Profile
Help with Setting up SFML 2.6 with CodeBlocks 20.03
« on: June 25, 2023, 11:14:06 am »
Hi all,

Please excuse me if this post belongs in another forum, or if the question has been asked recently.

I have downloaded the  CodeBlocks 20.03 with the MingW compiler. Once installed it works fine for the usual "Hello World" and "Expensive Calculator" apps.

I've downloaded both the 32bit and 64bit version of SFML 2.6, tried to install them and do a simple SFML program as per https://www.sfml-dev.org/tutorials/2.6/start-cb.php

No joy. I've tried re-installing Codeblocks and using the 32-bit version.

I have searched the MingW/bin folder and can not find the files "libgcc_s_sjlj-1.dll" or "libgcc_s_dw2-1.dll"
as recommended by the page.

IF it makes any difference I am using a Windows 10 laptop / notebook (an HP), and it is running the 64 bit version of Win10.

What am I getting wrong?

Any help and/or advice welcome.

Kind regards
Frank

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Help with Setting up SFML 2.6 with CodeBlocks 20.03
« Reply #1 on: June 25, 2023, 01:57:43 pm »
You probably overread the red box on the download page which states:

Quote
Unless you are using a newer version of Visual Studio, the compiler versions have to match 100%!
Here are links to the specific MinGW compiler versions used to build the provided packages:
WinLibs MSVCRT 13.1.0 (32-bit), WinLibs MSVCRT 13.1.0 (64-bit)

If you download Code::Blocks with the MinGW compiler included, the compiler won't match.
Either build from source, or use the CMake template (which builds from source), or replace your compiler with one mentioned on the download page (there are links).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Frank Scrooby

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Help with Setting up SFML 2.6 with CodeBlocks 20.03
« Reply #2 on: June 26, 2023, 11:10:20 am »
Hi  eXpl0it3r and everyone else

I probably should have been clearer about what wasn't working. The test app compiles but when I try to run it I get the console and an error message reading:

The procedure entry point _Zst28__throw_bad_array_new_lengthvc could not be located in dynamic link library c:\projects\SFML\P1\P!\Debug\sfml-windows-2.dll

Googling that error message made me no wiser, it is apparently a very common error message, with just the path and dll name differring.

Where can I get the correct compiler for the current version of SFML ?

I know its a brand new version but surely people would think to put a link to the correct compiler. I would if it was my project.

I am completely unfamiliar with the idea of compiling SFML for myself. IS there a tutorial or any advice on getting this done.

Thank you and please forgive my highly nube questions.

Thank and regards
Frank

Thrasher

  • SFML Team
  • Jr. Member
  • *****
  • Posts: 57
    • View Profile
Re: Help with Setting up SFML 2.6 with CodeBlocks 20.03
« Reply #3 on: June 26, 2023, 08:45:48 pm »
Quote
IS there a tutorial or any advice on getting this done.

Yes, Exploiter already gave the advice to use the CMake template here: https://github.com/SFML/cmake-sfml-project. Follow the instructions in the README. It uses normal CMake workflows so if you're familiar with CMake, this will just automatically work. It works on all OSes with all compilers and all IDEs.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Help with Setting up SFML 2.6 with CodeBlocks 20.03
« Reply #4 on: June 27, 2023, 08:06:48 am »
Make sure that your copied DLLs for SFML or the runtime are compatible with the compiler. If you've previously copied runtime libraries from a different MinGW distribution or have one in PATH, make sure you copy the DLLs from the new MinGW distribution.

Where can I get the correct compiler for the current version of SFML ?

I know its a brand new version but surely people would think to put a link to the correct compiler. I would if it was my project.
As said, it's on the download page ;)

https://www.sfml-dev.org/download/sfml/2.6.0/ 👀
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything