Hi, I need to use SFML with Code::BLocks. I have used it loads of times in the past and it has allways worked. This time though, even after following every step on 10+ tutorials I cannot get it to work. The problem is that the program starts and it works fine, until it gets to the first SFML command. Then it stops working. I have read about the MinGW being outdated and I have installed the latest versions, but it still will not work.

I doubt anyone could give me some steps to solve this problem, but if they could give me the CodeBlocks files with SFML already installed that would be great!

It stops working, but what kind of error do you get? Try putting some breakpoints and follow the execution step by step, also it would help us helping you by providing the piece of code you're trying to run. Perhaps it's not related to Code::Blocks at all.

This causes your program to think that a certain line ends in a place different to where you want it to, which can lead to undesired effects (although, why your compiler isn't throwing up some sort of error puzzles me).

Secondly: sf::Window should only need to be created once, outside the (while) loop. When I tried the same as your code, in my IDE, I had a window being created and destroyed over and over, whilst the loop ran. This lead to an effect by which a window would open and close every couple of seconds (maybe this is something your compiler doesn't like and crashes the program for you, I'm not sure, please correct me if I am wrong).

Try it with these and get back to us, if anything, it might not fix the problem, but allow a new (debugger tracked one) to be picked up.

You're kind of giving people misleading information as to how they can solve your problem. If you had posted a direct copy-paste of your code, myself, as well as other forum members, wouldn't need to waste time reading/responding to inaccurate data. We could get to the problem at hand. Now I realise a counter-argument might be that you said in your first post you're sure it's the fault of an outdated MinGW but, to follow up with what you provided might suggest to some that you are at a level of experience lower than you know you are.

So that the community could give more possible responses, could you tell us the versions of MinGW and SFML that you're using, have you tried to google information that includes these version numbers as your searches might be too general.

I would copy and paste the direct contents of your code. While it may not seem like your code has a problem it is very likely it can be. It happens all the time to programmers. We just know our code is right that nothing is wrong with it. Then we show it to someone else and they see it within 10 seconds. It can happen all the time in anything, not just programming. It's one of those things that happens when you look at something for too long. Sometimes you need a fresh set of eyes.

The chances of this being a Code::Blocks issue is very slim. If it compiles and links just fine and starts up then I don't see it being a Code::Blocks issue. I guess it is possible it could be something to do with the SFML files though first I'd want to see your code.

Next would be the project settings. I can assume it could be a possibility that your project settings aren't exactly right, though with just a basic SFML app I would think if you have it linked properly and it compiles fine then that would be fine too.

Seriously just copy and paste your code and we will do everything we can to try to help. We all make mistakes and we sometimes need fresh set of eyes to see the problem. If you have by chance fixed the issue then post your solution here. That way someone else who could be having the same problem could see and it could help someone else.

Without any of this information it's going to be nearly impossible to try to help you. That code you posted above, even though you said it was not a direct copy and paste (not sure why you wouldn't though), we immediately saw something.