So I made a 2D adventure game using c++ and SFML with the Code::Blocks IDE and the GNU GCC compiler. I have been working on it for several months and been doing bug fixes and everything. I want to publish my game to steam, or maybe a website for people to download for free and enjoy my game. However I do not know how to take my code on Code::Blocks and put it into a single application that when double-clicked it can be opened and ran as a game. Please help, it would be greatly appreciated.
-
How have you been working with codeblocks/gcc for several months, to the point of completing a game, and not know that a build is generated every time you run it? That's at least strange. Yes, the build is generated when you press the |> "play" button. – Ferreira da Selva Aug 27 '18 at 02:04
1 Answers
Code::Blocks builds your project before running it, meaning that an actual executable file is created from time to time anytime you run your program.
It is usually located in the "Release" build target folder, inside the current project folder. If your project is named "MyGame", and it is located at "X:{Program Files}\CodeBlocks\Projects\MyGame", then you'll find your executable in the subpath "\bin\Release" (or Debug, if you never ran a Release build).
An alternate way to find such executable is to browse the file browser in the Management section of the IDE. In Windows it looks like this:
Expanding the "bin" folder you'll find the build target subfolders, inside which the executable is located. Right-click on it, and then click "Copy To..." and choose the Desktop or another folder of choice:
This example is about a simple console application, only difference with a full-working application is you must copy other included files as well.

- 4,636
- 6
- 25
- 37
-
1Also, for an official release build you probably want to run gcc (...or g++) with some more optimization (I tend to use the -03 flag). If you do not know how to do this, you should really read some more about compilation - it's a necessary evil! :) – Anonymous Anonymous Aug 28 '18 at 10:57