go here
http://www.codeblocks.org/downloads/binariesdownload this
codeblocks-16.01mingw-nosetup.zip
put it in a folder
C:\New_folder\codeblocks-16.01mingw-nosetup.zip
unzip it
C:\New_folder\codeblocks-16.01mingw-nosetup
go here
http://www.sfml-dev.org/download/sfml/2.4.1/ download this
GCC 4.9.2 TDM (SJLJ) - 32-bit
put it in a folder
C:\New_folder\SFML-2.4.1-windows-gcc-4.9.2-tdm-32-bit.zip
unzip it
C:\New_folder\SFML-2.4.1-windows-gcc-4.9.2-tdm-32-bit
go to your codeblocks folder
C:\New_folder\codeblocks-16.01mingw-nosetup
run
CbLauncher.exe
it will ask you which compiler you want to use
it will tell you it has detected
GNU GCC Compiler
select and highlight that compiler and click the
Set as Default
button
then click
OK
now it may ask you if you want to set codeblocks as the default application for C and C++ files
choose any option you want - it does not matter
if it doesn't ask, that's ok
click the OK button
click the
Create a new project
option
a window will pop up with Project templates
scroll down and find
SFML project
select it and press Go
it will say
"Welcome to the SFML project wizard"
Click Next >
it will give you a choice for SFML 1.6 and SFML 2.0
make sure 2.0 is highlighted
press Next >
It will ask you which type of library to add
Choose Dynamic Link Library
press Next >
Project title = project_1
Folder to create project in = C:\New_folder\
press Next >
A window pops up asking you to select the location of SFML on your computer
it says
$(#sfml)
change it to
C:\New_folder\SFML-2.4.1-windows-gcc-4.9.2-tdm-32-bit\SFML-2.4.1
press Next >
a window pops up asking you about Debug and Release
leave as is
press Finish
A project and C++ file have been created for you
go to the codeblocks menu and press
Build
then
Build
Your program should build with no errors
you will not be able to run your program yet.
first go to
C:\New_folder\SFML-2.4.1-windows-gcc-4.9.2-tdm-32-bit\SFML-2.4.1\bin
copy all the files in ^ this folder
and paste them here (this is a copy, not a move)
C:\New_folder\project_1\bin\Debug
go to the codeblocks menu and press
Build
then
Run
this builds a 32 bit executable
going into the Project / Build options and selecting
c++11
or
c++14
will make no difference
this should be enough to get you started
however, you will eventually run into problems with this
as far as I can tell this version of the compiler leaves out some C++ functions that you might find in some SFML examples
specifically the
to_string
function
it was broken in MinGW and eventually fioxed in MinGW-w64
as detailed here
http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-gyou can eventually install a correct compiler and corresponding SFML version from the SFML download page
but this should be enough to get you started
oh, if you add
C:\New_folder\SFML-2.4.1-windows-gcc-4.9.2-tdm-32-bit\SFML-2.4.1\bin
to your PATH
or copy the dlls to a folder already in your PATH then you won't have to copy them all the time