Make sure you download the 32-bit SFML. More Info Below. ___ If you do everything 100% correct, but it still doesn't work: You might need to compile SFML from source for now, as the SFML download targets an older version of MinGW than what comes with CodeBlocks. ua-cam.com/video/DZigLFdSGeY/v-deo.html ____ Why 32Bit SFML? Well, you might think "hey my PC is 64 bit? Soooo I will go download the 64 bit SFML right?". This is wrong. The compiler CodeBlocks comes with is a 32-bit compiler, which means only 32-bit SFML is compatible with it. if you download the 64-bit SFML, it will not be compatible with the 32-bit compiler. Follow the video EXACT, and you won't get any errors. It is not hard, it will take maybe 20 to 30 mins of your life if you pause and resume as needs be. Once you do it once, you never have to do it again.
If you are using the newest SFML 2.5.1, You have to write "lib" in front of everything he does in Debug and Release, example: libsfml-graphics-d, libsfml-audio-d, libsfml-graphics, libsfml-audio. I hope this helps alot of you who always want the newest stuff available so you don't have to go for the older version ;)
Finally, someone who doesn't say "I've already got it installed so I'm not going to bother installing it again so just click ok and do whatever is in the description"
I have come from a different tutorial and still failed after 4 or 5 hours after watching this. I followed the exact same stuff and still I am missing libraries and or dlls. I tried different SFML versions,too. Uninstalled and reinstalled Code Blocks. I finally figured it out. If you come from the same holes I came from click on menu bar option SETTINGS and click on COMPILER. This will take you to GLOBAL settings for the exact same thing here. CLICK ON RESTORE DEFAULTS. This has saved me tons of work. THEN FOLLOW THESE INSTRUCTIONS described in the video.
THANK YOU SO MUCH!!! PS: Still works on 10/13/2019 . I installed on CodeBlocks 17.12 and download SFML 2.4.2 32 BITS and follow all the steps! No errors and draw the green circle, thank you!!!
Finally a tutorial that really worked for me. I have seen already a lot of outdated tutorials. Thank you, for real. You just gained my like, subscription and hearth. Well done, seriously
Very nice tutorial, easy to follow and to understand. I'm glad to hear you improved it after realizing many people were still strugling with an old one. There should be more people who are actually trying to do things better. Thanks a lot
guys i have the same problem first but when i uninstalled my code-block and mingw and re-downloaded the 32 version + sjls mingw , by following this video i finally compiled it successfully , thanks man great tutorial !
It works! Thank you so much! Also, there is a typo at 5:35. You checked a box that had C++ 11 when you stated in the video that you need C++ 14. I just created a flag manually to be safe.
I was getting the same issue as people in comment have pointed out. Procedure entry error. I solved this by using the sfml2.4.2 version instead of latest one. In the sfml download page there is a option of older version. Download the 2.4.2 one and this tutorial works fine. Hope this helps.
Important Note : You may have noticed that an annoying console appears when the GUI Appears, To disable it, Just right click the project, click Properties, select Build Targets, And choose GUI Instead of Console in the Drop-Down Box (Combo Box) Above ♥
hopson : "if u have thoses lines then code blocks is downloaded correctly" me : don't have anything also me: " what happen if i don't have it, what should i do ?" hopson : proceed to the next step me : where's my rope ?
Took more than one attempt due to confusion with the new 64-bit code blocks version causing an inability to find files, (at least I think that's what happened) but I got it working now. Thanks.
Sorry does not work. System Error : "The code execution cannot proceed because libgcc_s_sjlj-1.dll was not found. Reinstalling the program max fix the problem."
Regrading Entry Point Errors and the dll's that were copy/pasted: For those of you with a pre-existing MinGW install, fair warning: Code::Blocks may use that one and you will get errors about the dll's; a set of Entry Point errors. To fix this just go to the top bar of Code::Blocks, Settings, Compiler, Global Compiler Settings, Toolchain Executables, and change the field labeled "Compiler's installation directory" to be the MinGW folder in your Code::Blocks install. For me it was C:\Program Files (x86)\CodeBlocks\MinGW. The program files are all the same so just changing the directory should fix the problem. The internet would have you believe you must recompile SFML, but Code:Blocks currently comes with the right compiler, if you get these errors it just means it defaulted to a pre-existing (and wrong) version. Which you can fix much faster than recompiling SFML. Unless you want SFML in that version, in which case by all means recompile it with that version of MinGW/GCC.
Well, had some troubles along the way, and had to read some comments on the updated statues of all this to get it to work correctly, but it worked, I'm happy to start learning sfml finally.
it says the code exucution cannot proceede libggc_s_sjlj-1.dll was not found when i try to run i have been troubleshooting for days and its not working
//Testing code was missing from video description, so copy from here if you want. #include int main() { sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!"); sf::CircleShape shape(100.f); shape.setFillColor(sf::Color::Green); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(); window.draw(shape); window.display(); } return 0; }
February 17 / 2019 I followed this tutorial and works perfectly fine still. I had an error at first because when I tried to run the SFML program. The problem was that I downloaded both Visual Studio and CodeBlocks SFML libraries and mixed up the .dll files. So just be sure to download the correct SFML files for the IDE you're using.
Amazing!!! I followed step by step how it is in your video and it works (and that I speak Spanish) now I am going to try the examples with this library to have that videogames are seen. Excellent tutorial my congratulations.
hey Hopson, I really appreciate your video, I just have one problem, when i release it, it says "fatal error SFML/Grapics.hpp: No such file or directory" what is the solution?
I have one problem. Everything works when I do all the steps but when I created tamplate it doesnt.New project created from template just doesnt work. I have error: Graphics.hpp No such file directory :(
Great tutorial, thanks a lot! Also thanks to Aryan Parekh who solved my issue by suggesting an alternative SFML version when a "-l... not found" error is encountered.
@@aiex314 I'm pasting the comments of two other people below who provided the solution. The version by Aryan Parekh worked for me. If it doesn't work for you, try the other one. Aryan Parekh 5 months ago To all those who are facing a problem like: lgraphics-d not found etc etc Do not download the sfml option he has shown! download the GCC 7.3.0 MinGW (SEH) - 64-bit After this everything worked fine for me! xXSzynaXx 3 months ago If that's not work try GCC 7.3.0 MinGW (DW2) - 32-bit. For me it worked good. Everything else is same as in video.
Thanks for explaining bro, this is REALLY helpful. However, I noticed that you forgot to add openal32.dll file when you were creating project template (7:28).
I had a problem where it's said to me that he can't find all files "-lsfml..." To fix it, well, you must download the real version used in video, so download : sfml 2.4.2 code::block 16.01 after that, this worked fine for me :)
Followed the tutorial exactly how you did it, but I got 21 errors running the final code. They say something like this: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale' Any help?
After almost 1 day of struggle I found out. It turns out this tutorial is semi-outdated. the green circle worked but loadfromfile didn't. Codeblocks is now in version 17.12 and this sfml version only works completely for codeblocks 16.01. You can't use the codeblocks official link in the description anymore (at least until sfml updates or codeblocks fixes this bug). I used sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/ to get this version and I just followed the video and it worked.
The linkers dont seem to work when i try to run the exe in the bin folders, it shows 3 error windows: cannot find smfl-window-2.dll, cannot find smfl-system-2.dll, cannot find smfl-graphics-2.dll EDIT: HOW To fix: First look at your error messages, If it says something like ”missing file: remember that name, Then go to where you downloaded SFML And open the folder ”lib” then look for your file in that folder and you should find it, copy it and paste it in your projects bin folders(projectName/bin/debug and projectName/bin/release), REPEAT THIS process untill there are No errors left and your project should work when running the exe file when Codeblocks isnt opened. Its a fix that i found!!
hi bro first even i got same error so do some steps STEP 1:In the project's "Build options", "Search directories" tab, add: The path to the SFML headers (/include) to the Compiler search directories The path to the SFML libraries (/lib) to the Linker search directories STEP 2: THEN SELECT THE DEBUG OPTION IN DEBUG THE SELECT THE LINKER IN LINKER ADD THE "sfml-graphics-d sfml-system-d sfml-window-d" then save ! NOW AFTER SAVING IT STEP 3: IN RELEASE OPTION SELECT THE LINKER ADD THESE "sfml-graphics sfml-system sfml-window" then save ! THEN BHOOM U CAN EXECUTE IT ! WITHOUT ANY ERROR
I keep getting this error: The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library C:\PathToCodeBlocksProject\sfml-graphics-d-2.dll. (Same for window and system) Does anyone know the solution? Could it be the dependencies?
Seriously, @3:11, which one is it? You said click project name but when you are looking for Search Directories, DEBUG is highlighted in the background!
I just wanted to share, if you think that you're 100% sure you followed the steps, but still got errors like these: ld.exe cannot find -lsfml-graphics-d ld.exe cannot find -lsfml-audio-d ld.exe cannot find -lsfml-network-d ld.exe cannot find -lsfml-window-d ld.exe cannot find -lsfml-system-d Code::Blocks had new updates this March 19, 2020. They added a new note, which says "The default builds are 64 bit (starting with release 20.03). We also provide 32 bit builds for convenience.". Just like what Mr. Hopson said, download the 32-bit SFML for the 32-bit Code::Blocks, since SFML still doesn't provide an official 64-bit dependencies for the 64-bit Code::Blocks at this time. It took me couple of hours to fix this problem. but now it's working.
I have this exact problem, I have downloaded the GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit SFML version and codeblocks-20.03mingw-setup C::B version. Everything is properly linked but it still does not work. Could you maybe help me out?
For those watching this in 2020 and beyond, this did not work for me as stated in the video. BUT this is how I fixed it. I installed Code::Blocks 20.03 which came out in March of 2020. The version of SFML i installed was 32 bit, when code blocks was 64 bit. So on the SFML web site I downloaded and installed GCC 7.3.0 MinGW (SEH) - 64-bit and the application worked for me.
yay this one worked ive been trying to get sfml to work with codeblocks on windows for months cause i love open source ide thanks! maybe consider doing a cocos2dx + codeblocks with windows installation tutorial?
I always struggle to add libraries to IDE projects... Thank you so much! Even 2 years later this is still incredibly helpful. Could you do one explaining how to use the Static libraries instead?
Another fix for the "Procedure entry point" errors is to set Code::Blocks to use the correct MinGW installation in the Code::Blocks install directory if you have installed MinGW in the past.
My templates are not saving for some reason. It says "failed to create directory for project file" and then "some files could not be saved with the template". Also I am getting an issue where the debug and run within codeblocks works splendidly but when I try to run the release build exe it doesn't find the dll files
till the red circle is all ok, then I "couldn't create directory for user template C:\Program files(x86)\CodeBlocks\AppData\CodeBlocks\UserTemplate " why this happens??
In addition to 32bit and 64, the windows version of SFML has two more options, SJLJ and DW2. Check this article for guidance in this matter: www.sfml-dev.org/tutorials/2.0/start-cb.php
I tried to install SDL2 for 2 hours and I miserably failed. Then I learned about SFML in some forms. I managed to set it up in one try thanks to your tutorial. You are doing the God's work.
I've followed your instructions and when I try to run the program,a error box pops up saying "The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic link library sfml-graphics-2.dll".How do I fix this?
Weird how the official tutorial isn't working but yours does. Could it have to do with there being a newly released version of Codeblocks? Anyway, thanks for the help. Wish I had found your video three hours ago.
Ok, so, I downloaded and installed everything, all fine and well, but when I try to run the code given in the description, my security doesn't allow me to open SFML, because: "A file or program has triggered a DeepGuard heuristic detection because it performs (or contains instructions for) actions that resemble known harmful programs." The thing is, the link for SFML givin in the description literally forbids me to visit it, so I had to go around that. Could it be that I ended up dowloading a wrong version or something?
Awesome tutorial, works great for the most part! However, when I create another project with the template I've saved and build it, I get errors regarding the linking of the static libraries. I checked, and found out that while all of the .dlls were being included in the template, the linker settings were not. While this is only a minor inconvenience, I'd love it if you could point me to a fix. Thanks a lot!
it works, thanks, but when I use texture.loadFromFile(); it gives error of "undefined reference to _imp_" something like this can you help me with this.
Mine doesn't work. When i click build, it builds for a few secs. then when i click run, it says "you haven't built anything, want to build?" I click yes, but it still doesn't build. I know it probably is something i have done, but i don't know.
I believe in order to minimise the confusion it would have been better to choose the other name for the project good job though also I would recommend a note about possible antivirus popup when U launch your application using code::blocks
2 days into trying to make this work: followed this and other tutorials (including the official one on sfml website) multiple times, even tried setting sfml as statically linked but it never worked. I also built sfml using a different compiler that I then used with CodeBlocks. In some tutorials the test script compiles well, then if I try running it it complains that libgcc_s_sjlj-1.dll is missing. Once I place it in the folder it says that sfml-graphics-d-2.dll has some huge problem. I am so discouraged now that I will give up. This could have been fun if only it worked. I don't understand why it works for other people...
Ok I got it to work. The problem was that the compiler that comes with Code::Blocks was incompatible with the SFML that was specifically made for that version of Code::Blocks. At least that is what I think, I'm no expert. Solution: you have to build SFML yourself using CMake (follow the tutorial on www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php ). On my Windows 10 this went as follows: 1.) download the source code (www.sfml-dev.org/download/sfml/2.5.1/) and extract it into a folder, let's call its address "X" (don't move it from there anymore) 1.5) add "C:\Program Files (x86)\CodeBlocks\MinGW\bin" to your path environment (idk if this is necessary, probably can skip) 2.) start CMake-gui (google for it if you don't have it) set "Where is the source code" to the folder "X" set "Where to build the binaries" to folder "X" too 4.) click "Configure" and use the compiler "MinGW Makefiles", confirm 5.) in that red list set CMAKE_CODEBLOCKS_EXECUTABLE = C:/Program Files (x86)/CodeBlocks/codeblocks.exe CMAKE_BUILD_TYPE = Release 6.) Hit "Generate" 7.) open the "SFML.cbp" file in "X" folder using Code::Blocks and compile it, close Code::Blocks when done. 8.) You now have the "Release" .dll's in your "X\lib" folder, but you'll need the "Debug" ones too. To get them repeat steps 2.)-7.) but this time in step 5.) use CMAKE_BUILD_TYPE = Debug Then you end up with the correct .dll files sfml-network-d-2.dll sfml-system-2.dll sfml-system-d-2.dll sfml-window-2.dll sfml-window-d-2.dll sfml-audio-2.dll sfml-audio-d-2.dll sfml-graphics-2.dll sfml-graphics-d-2.dll sfml-network-2.dll 9.) Ok now just follow 2:40 - 5:26 (steps 5 and 6) in the video and continue from there. 10.) After building your main.cpp don't forget to drop all the dll's listed above into your Project\bin\Debug\ folder or wherever else your compiled .exe is located.
If you are using a custom compiler with Code::Blocks you need to complete steps 2.)-8.) from the command line using cmake and your compiler to build the files. Ask me if you need instructions. Using a custom compiler fixed the issue I had with the flag "-std=c++14"
Guys if u have any problems even u follow the full video, check your code:blocks version and sfml version, best way is to download the last version of codeblocks and sfml, gcc numbers have to be the same, for example gcc 5.1.0 works only when u have the same gcc on your code blocks. Sorry for english ;)
IT WORKS :) things to have : 1)an IDE (CODE BLOCKS)-i downloaded the simple codeblocks installer (without in-build MinGW). 2)SFML folder 3)MinGW main things to consider to work with SFML and code blocks : 1)SFML version must be compatible with the version of your MinGW c++ compiler . 2) follow this tutorial to build the "SFML Works " console application . personally i did not completely follow the tutorial ,because i already had downloaded MinGW and SFML files from other site (nightlybuilds.ch/project/show/1/SFML/) however i say this tutorial works good. thanks for the tutorial again . I use Code Blocks for SFML what i did is this : 1)i deleted the MinGW folder which was already present in my C drive . 2)used this (nightlybuilds.ch/project/show/1/SFML/) to download the MinGW Builds Posix SEH (710r0) x64 and its suggested SFML file. 3)extracted the MinGW folder and moved it to my c drove (dont move it in to program files) 4)setup system environment variables to have "C:\SFML\bin". 5)extracted and moved the SFML folder to C drive . 6)Installed CODE BLOCKS IDE and it auto detected the MinGW Compiler. 7)tested a Hello world program .it worked fine . after this i FOLLOWED this video and it workd .:) i am new to all this i wanted to make games not using game engines but through pure coding i spent like 6 days to get this sfml stuff work with codeblocks . however i would like to know if its possible to make games with pure coding and without using stuffs like opengl,vulkan,SFML,GLFW,SDL etcetc . WARNING: wow , when i save the telplate -saved successfully but when i load the user template it says "some files could not be loaded with the template ", may be i have done some mistake from my side .
It works in Codeblocks. But I get the following message in an error window when running the exe directly: The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic library D:\Projects\SFML\bin\Debug\sfml-system-d-2.dll (I had copied all dlls to the Debug folder where including the exe file)
I solved the problem by copying all the .dll C:\Program Files (x86)\CodeBlocks\MinGW\bin to exe folder C:\Code_Blocks Projects\SFML\bin\Debug That solved the problem note: Don't forget to include all .dll sfml too.
if you have any error like "...\main.cpp|1|fatal error: SFML\graphics: No such file or directory|" close program. it askes "... do you want to save it?" say yes and re-open. closing and opening may solve other problems.
Actually they were good, I tried an other similar Tutorial about a game engine AND NOPE yours is better at least to me Thank you so much for sharing the link ! :D
im tried for 1 hours and the problem was very stupid. in the 2:38 i selected C:/MinGw/include and was C:/MinGW/include/SFML-2.5.1/include anyway, THANKS!!!
Make sure you download the 32-bit SFML. More Info Below.
___
If you do everything 100% correct, but it still doesn't work:
You might need to compile SFML from source for now, as the SFML download targets an older version of MinGW than what comes with CodeBlocks.
ua-cam.com/video/DZigLFdSGeY/v-deo.html
____
Why 32Bit SFML?
Well, you might think "hey my PC is 64 bit? Soooo I will go download the 64 bit SFML right?".
This is wrong.
The compiler CodeBlocks comes with is a 32-bit compiler, which means only 32-bit SFML is compatible with it. if you download the 64-bit SFML, it will not be compatible with the 32-bit compiler.
Follow the video EXACT, and you won't get any errors. It is not hard, it will take maybe 20 to 30 mins of your life if you pause and resume as needs be.
Once you do it once, you never have to do it again.
Where is the playlist shown in the video?
ua-cam.com/play/PLMZ_9w2XRxiaz3_mrIviTEg4-BcFFjFDS.html
I unlisted it because i didn't feel it was good quality
Hopson I knew it xD. Thank you so much!!!
Y'know this would have been useful IN THE VIDEO, I need to do everything again god damn.
I assumed people would actually follow the video rather than guess.
Linker settings:
sfml-graphics-d
sfml-audio-d
sfml-network-d
sfml-window-d
sfml-system-d
sfml-graphics
sfml-audio
sfml-network
sfml-window
sfml-system
If you are using the newest SFML 2.5.1, You have to write "lib" in front of everything he does in Debug and Release, example: libsfml-graphics-d, libsfml-audio-d, libsfml-graphics, libsfml-audio. I hope this helps alot of you who always want the newest stuff available so you don't have to go for the older version ;)
I still can't get it to work any ideas?
@@RachelUndercover What happens when you try to build the program? Could you tek what the error is you get?
@@UberFile Still no such file or directory
I m fucking idiot typo
@@luki-fg6qr So you figured out your problem? ;)
Finally, someone who doesn't say "I've already got it installed so I'm not going to bother installing it again so just click ok and do whatever is in the description"
Quedaria con lel meme este de final mente. Dea re. y tienes razon
Yes! I hop everyone with tutorial videos see this
I have come from a different tutorial and still failed after 4 or 5 hours after watching this. I followed the exact same stuff and still I am missing libraries and or dlls. I tried different SFML versions,too. Uninstalled and reinstalled Code Blocks.
I finally figured it out.
If you come from the same holes I came from click on menu bar option SETTINGS and click on COMPILER. This will take you to GLOBAL settings for the exact same thing here.
CLICK ON RESTORE DEFAULTS. This has saved me tons of work.
THEN FOLLOW THESE INSTRUCTIONS described in the video.
thanks, i was getting a similar error
u r a legend
It works! mate, I tested it on 17.06.2019, and it still works! many thanks from Germany.
works on 17.12 also .. if any one see that
@md rakib1510 I was getting issues as well what error did u get?
THANK YOU SO MUCH!!!
PS: Still works on 10/13/2019 .
I installed on CodeBlocks 17.12 and download SFML 2.4.2 32 BITS and follow all the steps! No errors and draw the green circle, thank you!!!
You could download the newer version.
Finally a tutorial that really worked for me. I have seen already a lot of outdated tutorials. Thank you, for real. You just gained my like, subscription and hearth. Well done, seriously
Very nice tutorial, easy to follow and to understand. I'm glad to hear you improved it after realizing many people were still strugling with an old one. There should be more people who are actually trying to do things better. Thanks a lot
guys i have the same problem first but when i uninstalled my code-block and mingw and re-downloaded the 32 version + sjls mingw , by following this video i finally compiled it successfully , thanks man great tutorial !
Been trying to get this to work all day, and I finally got it set up because of this tutorial. Thanks a ton!
I was struggling over 1 hour trying to set up SFML for Codeblocks by reading the SFML tutorial. Then I found this video and it worked! Thank you!
Thank you so much for helping me ! This is the first tutorial in which the code actually worked :)
Codeblocks 17.12 + everything else from your tutorial finally worked after dozens of hours and failed attempts, you saved my ass, thank you so much
It works! Thank you so much! Also, there is a typo at 5:35. You checked a box that had C++ 11 when you stated in the video that you need C++ 14. I just created a flag manually to be safe.
I was getting the same issue as people in comment have pointed out. Procedure entry error. I solved this by using the sfml2.4.2 version instead of latest one. In the sfml download page there is a option of older version. Download the 2.4.2 one and this tutorial works fine. Hope this helps.
Thanks, it worked :)
Honestly God Bless, Thank You So Much, You Saved Me So Many Times From Failure In The Future
I've Honestly Been Stuck On This 4 Ages! Like Months lol
Important Note : You may have noticed that an annoying console appears when the GUI Appears, To disable it, Just right click the project, click Properties, select Build Targets, And choose GUI Instead of Console in the Drop-Down Box (Combo Box) Above ♥
Thanks a lot man, this worked nice and clean! Very good video! Keep doing more like these please :D
U help me a lot! At the first time, it didnt worked becausa i had the wrong sfml installed. THANK U SO MUCH!
hopson : "if u have thoses lines then code blocks is downloaded correctly"
me : don't have anything
also me: " what happen if i don't have it, what should i do ?"
hopson : proceed to the next step
me : where's my rope ?
A lot of thanks man! I subscribed! I could not set up sfml with any tutorial. Thanks a lot!
Thanks so much for this! I wanted to get SFML working outside of a virtual machine and spent all day on it until finding this video.
Took more than one attempt due to confusion with the new 64-bit code blocks version causing an inability to find files, (at least I think that's what happened) but I got it working now. Thanks.
Sorry does not work. System Error : "The code execution cannot proceed because libgcc_s_sjlj-1.dll was not found. Reinstalling the program max fix the problem."
Regrading Entry Point Errors and the dll's that were copy/pasted:
For those of you with a pre-existing MinGW install, fair warning: Code::Blocks may use that one and you will get errors about the dll's; a set of Entry Point errors. To fix this just go to the top bar of Code::Blocks, Settings, Compiler, Global Compiler Settings, Toolchain Executables, and change the field labeled "Compiler's installation directory" to be the MinGW folder in your Code::Blocks install.
For me it was C:\Program Files (x86)\CodeBlocks\MinGW. The program files are all the same so just changing the directory should fix the problem.
The internet would have you believe you must recompile SFML, but Code:Blocks currently comes with the right compiler, if you get these errors it just means it defaulted to a pre-existing (and wrong) version. Which you can fix much faster than recompiling SFML.
Unless you want SFML in that version, in which case by all means recompile it with that version of MinGW/GCC.
Thank you, this fixed the unrecognized -std=c++14 error some people were getting
Thanks
OMG THANK YOU U SAVED ME LIKE 20 HOURS OF WORK
Dude, thank you, you just saved me a lot of time and deceptions
Well, had some troubles along the way, and had to read some comments on the updated statues of all this to get it to work correctly, but it worked, I'm happy to start learning sfml finally.
it says the code exucution cannot proceede libggc_s_sjlj-1.dll was not found when i try to run i have been troubleshooting for days and its not working
did you fixed it ? I have the same issue
//Testing code was missing from video description, so copy from here if you want.
#include
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
I can't copy it
February 17 / 2019
I followed this tutorial and works perfectly fine still.
I had an error at first because when I tried to run the SFML program. The problem was that I downloaded both Visual Studio and CodeBlocks SFML libraries and mixed up the .dll files. So just be sure to download the correct SFML files for the IDE you're using.
Thanks for your video! It helped me a lot by setting up my first (and template project) with SFML :)
100% works i had just followed extact same steps as shown and it works. commented on 12 april 2018 tested with latest version of code block and sfml
after weeks trying to set it up, it finally works!! thank youu
Amazing!!! I followed step by step how it is in your video and it works (and that I speak Spanish) now I am going to try the examples with this library to have that videogames are seen. Excellent tutorial my congratulations.
hey Hopson, I really appreciate your video, I just have one problem, when i release it, it says "fatal error SFML/Grapics.hpp: No such file or directory" what is the solution?
+
I have one problem. Everything works when I do all the steps but when I created tamplate it doesnt.New project created from template just doesnt work. I have error: Graphics.hpp No such file directory :(
The same happens to me. There must be some step missing.
open your code::blocks > open settings > click compilers > go to directories files > add > go to sfml folder > done
@@mauricioaviles Yo, just answered this. Hope it helped
Great tutorial, thanks a lot! Also thanks to
Aryan Parekh who solved my issue by suggesting an alternative SFML version when a "-l... not found" error is encountered.
Which SFML version did you you instead?
@@aiex314 I'm pasting the comments of two other people below who provided the solution. The version by Aryan Parekh worked for me. If it doesn't work for you, try the other one.
Aryan Parekh
5 months ago
To all those who are facing a problem like:
lgraphics-d not found etc etc
Do not download the sfml option he has shown! download the GCC 7.3.0 MinGW (SEH) - 64-bit
After this everything worked fine for me!
xXSzynaXx
3 months ago
If that's not work try GCC 7.3.0 MinGW (DW2) - 32-bit. For me it worked good. Everything else is same as in video.
I get an error "libgcc_s_sjlj-1.dll was not found" can you plz help me fix it
did you fixed it ? I have the same issue...
Thanks for explaining bro, this is REALLY helpful. However, I noticed that you forgot to add openal32.dll file when you were creating project template (7:28).
With regret :(
You missed one .dll file at 7:28
Not an sfml file
I watched this video so many times i've learned it by heart lol
Thank you very much! I was looking for a tutorial in spanish but none of them worked, seriously thanks a lot!
Thank you, it works on 01-09-2019. If it doesn't work for you, make sure you download the latest version of code blocks.
I had a problem where it's said to me that he can't find all files "-lsfml..."
To fix it, well, you must download the real version used in video, so download :
sfml 2.4.2
code::block 16.01
after that, this worked fine for me :)
Aahhh , finally worked after 15 hours, thanks man
thank you so much for this ,it worked like a charm on the first try, godlike support.
7:27 you didn't you add openal32.dll and I finished video 6 and now I have an error saying openal32.dll was not found
Followed the tutorial exactly how you did it, but I got 21 errors running the final code. They say something like this: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
Any help?
same. When I use loadFromFile("name"), I get "undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_string..." Any help?
After almost 1 day of struggle I found out. It turns out this tutorial is semi-outdated. the green circle worked but loadfromfile didn't. Codeblocks is now in version 17.12 and this sfml version only works completely for codeblocks 16.01. You can't use the codeblocks official link in the description anymore (at least until sfml updates or codeblocks fixes this bug). I used sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/
to get this version and I just followed the video and it worked.
Well, I moved on to another thing that isn't SFML. The only problem is setting it up.
same
why wouldn't I use the latest version?
I realized what my error was, I downloaded SFML 64-bit because I didn't think it would make a difference (my computer is 64-bit), thank you so much!
SFML my life..!
Edit: Thank you so much!
hello there mine is still not working i need help
it is telling that || siji-1.dll || not found
did you fixed it ? I have the same issue...
I have a problem. It is written here that "cannot find -1graphics-d". Can you help me?
help me bro .It is said can not find graphics-d audio-d ..
The linkers dont seem to work when i try to run the exe in the bin folders, it shows 3 error windows: cannot find smfl-window-2.dll, cannot find smfl-system-2.dll, cannot find smfl-graphics-2.dll
EDIT: HOW To fix:
First look at your error messages,
If it says something like ”missing file: remember that name,
Then go to where you downloaded SFML And open the folder ”lib” then look for your file in that folder and you should find it, copy it and paste it in your projects bin folders(projectName/bin/debug and projectName/bin/release), REPEAT THIS process untill there are No errors left and your project should work when running the exe file when Codeblocks isnt opened.
Its a fix that i found!!
hi bro first even i got same error
so do some steps
STEP 1:In the project's "Build options", "Search directories" tab, add:
The path to the SFML headers (/include) to the Compiler search directories
The path to the SFML libraries (/lib) to the Linker search directories
STEP 2: THEN SELECT THE DEBUG OPTION
IN DEBUG THE SELECT THE LINKER IN LINKER ADD THE
"sfml-graphics-d
sfml-system-d
sfml-window-d"
then save !
NOW AFTER SAVING IT
STEP 3: IN RELEASE OPTION
SELECT THE LINKER ADD THESE
"sfml-graphics
sfml-system
sfml-window"
then save !
THEN BHOOM U CAN EXECUTE IT ! WITHOUT ANY ERROR
@@manalpha8183 still same error
I keep getting this error: The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library C:\PathToCodeBlocksProject\sfml-graphics-d-2.dll. (Same for window and system) Does anyone know the solution? Could it be the dependencies?
Same
I have the same problem!
have you ever found a solution?
GosNN Petar I am now using Visual Studio 2017 there it workes perfectly
it's quite buggy for me :(
Seriously, @3:11, which one is it? You said click project name but when you are looking for Search Directories, DEBUG is highlighted in the background!
busterzz project name
I just wanted to share, if you think that you're 100% sure you followed the steps, but still got errors like these:
ld.exe cannot find -lsfml-graphics-d
ld.exe cannot find -lsfml-audio-d
ld.exe cannot find -lsfml-network-d
ld.exe cannot find -lsfml-window-d
ld.exe cannot find -lsfml-system-d
Code::Blocks had new updates this March 19, 2020. They added a new note, which says "The default builds are 64 bit (starting with release 20.03). We also provide 32 bit builds for convenience.".
Just like what Mr. Hopson said, download the 32-bit SFML for the 32-bit Code::Blocks, since SFML still doesn't provide an official 64-bit dependencies for the 64-bit Code::Blocks at this time. It took me couple of hours to fix this problem. but now it's working.
I have this exact problem, I have downloaded the GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit SFML version and codeblocks-20.03mingw-setup C::B version. Everything is properly linked but it still does not work. Could you maybe help me out?
@@ognjenpingvin I think there's another setup file for 32-bit called codeblocks-20.03mingw-32bit-setup
@@ognjenpingvin have you fixed it already?
For those watching this in 2020 and beyond, this did not work for me as stated in the video. BUT this is how I fixed it.
I installed Code::Blocks 20.03 which came out in March of 2020.
The version of SFML i installed was 32 bit, when code blocks was 64 bit. So on the SFML web site I downloaded and installed GCC 7.3.0 MinGW (SEH) - 64-bit and the application worked for me.
Really ??
Finally after wasting 2 days i installed it correctly. Thanks man
Thank you, it worked at the first time!
I keep getting this error too: unrecognized command line option "-std=c++14" Why?
yay this one worked ive been trying to get sfml to work with codeblocks on windows for months cause i love open source ide thanks! maybe consider doing a cocos2dx + codeblocks with windows installation tutorial?
7:27 you did'nt select openal32.dll file. Is it ok ?
This is so informative and amazing... Really liked this.
Anyone else getting " libgcc_s_sjlj-1.dll" is missing?
19 NOV 2020 - Still working. Thank you so much sir
I always struggle to add libraries to IDE projects... Thank you so much! Even 2 years later this is still incredibly helpful.
Could you do one explaining how to use the Static libraries instead?
Did everything exactly as tutorial said and it worked.
Another fix for the "Procedure entry point" errors is to set Code::Blocks to use the correct MinGW installation in the Code::Blocks install directory if you have installed MinGW in the past.
@Toxic King If I recall correctly It does that for you after changing the path.
My templates are not saving for some reason. It says "failed to create directory for project file" and then "some files could not be saved with the template". Also I am getting an issue where the debug and run within codeblocks works splendidly but when I try to run the release build exe it doesn't find the dll files
till the red circle is all ok, then I "couldn't create directory for user template C:\Program files(x86)\CodeBlocks\AppData\CodeBlocks\UserTemplate " why this happens??
i have a problem, it compile fine but throws an error in the runtime, missing libgcc_s_sjlj-1.dll reinstall to fix, help pls
Same problem here
@@dimitrisbellos01 same problem here x2 help
@@dimitrisbellos01 i fix that error by
searching the file in my pc and paste it in the project folder but now a have another error with other file :C
The code execution cannot proceed because libgcc_s_sjlj-1.dll was not found. Reinstalling the program may fix this problem.
did you fixed it ? I have the same issue
it does not work. It pops the next message:
he code execution cannot proceed because libgcc_s_sjlj-1.dll... Help!
In addition to 32bit and 64, the windows version of SFML has two more options, SJLJ and DW2. Check this article for guidance in this matter: www.sfml-dev.org/tutorials/2.0/start-cb.php
I tried to install SDL2 for 2 hours and I miserably failed. Then I learned about SFML in some forms. I managed to set it up in one try thanks to your tutorial. You are doing the God's work.
it said cannot find -lsfml-graphics-d
I've followed your instructions and when I try to run the program,a error box pops up saying "The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic link library sfml-graphics-2.dll".How do I fix this?
i have the same problem
same problem :(
it happens only when i try to run the program from outsidethe codeblocks (and yes i have already included the ddls in the corect directory)
I have the same issue www.cplusplus.com/forum/beginner/102602/ might help
did u fix this?
Weird how the official tutorial isn't working but yours does. Could it have to do with there being a newly released version of Codeblocks? Anyway, thanks for the help. Wish I had found your video three hours ago.
11/10/2019
Still works even on SFML 2.5.1 Thank you! IF U HAVE PROBLEMS WITH .DLL FILES JUST STOP USING WIN7 XD
Ok, so, I downloaded and installed everything, all fine and well, but when I try to run the code given in the description,
my security doesn't allow me to open SFML, because:
"A file or program has triggered a DeepGuard heuristic detection because it performs
(or contains instructions for) actions that resemble known harmful programs."
The thing is, the link for SFML givin in the description literally forbids me to visit it,
so I had to go around that. Could it be that I ended up dowloading a wrong version or something?
Thank you! but where did your sfml engine tutorial playlist go man?
Awesome tutorial, works great for the most part! However, when I create another project with the template I've saved and build it, I get errors regarding the linking of the static libraries. I checked, and found out that while all of the .dlls were being included in the template, the linker settings were not. While this is only a minor inconvenience, I'd love it if you could point me to a fix. Thanks a lot!
it works, thanks, but when I use texture.loadFromFile(); it gives error of "undefined reference to _imp_" something like this can you help me with this.
Mine doesn't work. When i click build, it builds for a few secs. then when i click run, it says "you haven't built anything, want to build?" I click yes, but it still doesn't build. I know it probably is something i have done, but i don't know.
Thank you! This is a really good tutorial!
I followed the steps exactly, but whenever I try to run the program I get this error libgcc_s_sjlj-1.dll is missing
plz help
Make shure you have downloaded the 32 bit version of sfml
I have tried so many times but constantly got “cannot find -sfml-graphics-d”and or the things ended with "-d"
it works for me here! Thanks Hopson!
I believe in order to minimise the confusion it would have been better to choose the other name for the project
good job though
also I would recommend a note about possible antivirus popup when U launch your application using code::blocks
2 days into trying to make this work:
followed this and other tutorials (including the official one on sfml website) multiple times, even tried setting sfml as statically linked but it never worked. I also built sfml using a different compiler that I then used with CodeBlocks. In some tutorials the test script compiles well, then if I try running it it complains that libgcc_s_sjlj-1.dll is missing. Once I place it in the folder it says that sfml-graphics-d-2.dll has some huge problem. I am so discouraged now that I will give up. This could have been fun if only it worked. I don't understand why it works for other people...
Ok I got it to work. The problem was that the compiler that comes with Code::Blocks was incompatible with the SFML that was specifically made for that version of Code::Blocks. At least that is what I think, I'm no expert.
Solution:
you have to build SFML yourself using CMake (follow the tutorial on www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php ).
On my Windows 10 this went as follows:
1.) download the source code (www.sfml-dev.org/download/sfml/2.5.1/) and extract it into a folder, let's call its address "X" (don't move it from there anymore)
1.5) add "C:\Program Files (x86)\CodeBlocks\MinGW\bin" to your path environment (idk if this is necessary, probably can skip)
2.) start CMake-gui (google for it if you don't have it)
set "Where is the source code" to the folder "X"
set "Where to build the binaries" to folder "X" too
4.) click "Configure" and use the compiler "MinGW Makefiles", confirm
5.) in that red list set
CMAKE_CODEBLOCKS_EXECUTABLE = C:/Program Files (x86)/CodeBlocks/codeblocks.exe
CMAKE_BUILD_TYPE = Release
6.) Hit "Generate"
7.) open the "SFML.cbp" file in "X" folder using Code::Blocks and compile it, close Code::Blocks when done.
8.) You now have the "Release" .dll's in your "X\lib" folder, but you'll need the "Debug" ones too. To get them repeat steps 2.)-7.) but this time in step 5.) use
CMAKE_BUILD_TYPE = Debug
Then you end up with the correct .dll files
sfml-network-d-2.dll
sfml-system-2.dll
sfml-system-d-2.dll
sfml-window-2.dll
sfml-window-d-2.dll
sfml-audio-2.dll
sfml-audio-d-2.dll
sfml-graphics-2.dll
sfml-graphics-d-2.dll
sfml-network-2.dll
9.) Ok now just follow 2:40 - 5:26 (steps 5 and 6) in the video and continue from there.
10.) After building your main.cpp don't forget to drop all the dll's listed above into your Project\bin\Debug\ folder or wherever else your compiled .exe is located.
If you are using a custom compiler with Code::Blocks you need to complete steps 2.)-8.) from the command line using cmake and your compiler to build the files. Ask me if you need instructions. Using a custom compiler fixed the issue I had with the flag "-std=c++14"
u won't believe that, an hour ago i tried the older tutorial and i had some errors, i'll try it again now :D
D:
I hope this one goes better! :D
Guys if u have any problems even u follow the full video, check your code:blocks version and sfml version, best way is to download the last version of codeblocks and sfml, gcc numbers have to be the same, for example gcc 5.1.0 works only when u have the same gcc on your code blocks. Sorry for english ;)
how do i know the gcc of my code blocks?
IT WORKS :)
things to have :
1)an IDE (CODE BLOCKS)-i downloaded the simple codeblocks installer (without in-build MinGW).
2)SFML folder
3)MinGW
main things to consider to work with SFML and code blocks :
1)SFML version must be compatible with the version of your MinGW c++ compiler .
2) follow this tutorial to build the "SFML Works " console application .
personally i did not completely follow the tutorial ,because i already had downloaded MinGW and SFML files from other site (nightlybuilds.ch/project/show/1/SFML/)
however i say this tutorial works good. thanks for the tutorial again .
I use Code Blocks for SFML
what i did is this :
1)i deleted the MinGW folder which was already present in my C drive .
2)used this (nightlybuilds.ch/project/show/1/SFML/) to download the
MinGW Builds Posix SEH (710r0) x64 and its suggested SFML file.
3)extracted the MinGW folder and moved it to my c drove (dont move it in to program files)
4)setup system environment variables to have "C:\SFML\bin".
5)extracted and moved the SFML folder to C drive .
6)Installed CODE BLOCKS IDE and it auto detected the MinGW Compiler.
7)tested a Hello world program .it worked fine .
after this i FOLLOWED this video and it workd .:)
i am new to all this
i wanted to make games not using game engines but through pure coding
i spent like 6 days to get this sfml stuff work with codeblocks .
however i would like to know if its possible to make games with pure coding and without using stuffs like opengl,vulkan,SFML,GLFW,SDL etcetc .
WARNING:
wow , when i save the telplate -saved successfully
but when i load the user template it says "some files could not be loaded with the template ", may be i have done some mistake from my side .
It works in Codeblocks. But I get the following message in an error window when running the exe directly:
The procedure entry point _ZSt24__throw_out_of_range_fmtPKcz could not be located in the dynamic library D:\Projects\SFML\bin\Debug\sfml-system-d-2.dll
(I had copied all dlls to the Debug folder where including the exe file)
Yes same here
I solved the problem by copying all the .dll C:\Program Files (x86)\CodeBlocks\MinGW\bin to exe folder C:\Code_Blocks Projects\SFML\bin\Debug That solved the problem note: Don't forget to include all .dll sfml too.
I'm getting two errors
1) shape was not declared in this scope.
2) window was not declared in this scope.
You can add std::window before it
if you have any error like "...\main.cpp|1|fatal error: SFML\graphics: No such file or directory|" close program. it askes "... do you want to save it?" say yes and re-open. closing and opening may solve other problems.
Awesome tutorial! Many thanks! :)
Did you delete the SFML/C++ game engine tutorial I cant seem to find it :(
Not deleted
Just hidden
ua-cam.com/play/PLMZ_9w2XRxiaz3_mrIviTEg4-BcFFjFDS.html
I feel they were not very good lol
Actually they were good, I tried an other similar Tutorial about a game engine AND NOPE yours is better at least to me
Thank you so much for sharing the link ! :D
Bro it says the procedure entry point_ZSt28_throw_bad_new_lengthv could not be located in the dynamic link Library
im tried for 1 hours and the problem was very stupid. in the 2:38 i selected C:/MinGw/include and was C:/MinGW/include/SFML-2.5.1/include
anyway, THANKS!!!