Hello. I tried to install sfml on codeblocks but when I try to build the sample program on the site it just doesnt do it. This is the build log when I try to build it. As I am new to this and dont understand anything any help will be greatly apreciated :)
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -DSFML_STATIC -IC:\Users\jaaga\Desktop\SFML\SFML-2.4.0\include -c C:\Users\jaaga\Desktop\CodeBlocks\test\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib -o bin\Debug\test.exe obj\Debug\main.o -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget5clearERKNS_5ColorE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:106: undefined reference to `glClearColor@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:107: undefined reference to `glClear@4'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget4drawEPKNS_6VertexEjNS_13PrimitiveTypeERKNS_12RenderStatesE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:276: undefined reference to `glVertexPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:277: undefined reference to `glColorPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:278: undefined reference to `glTexCoordPointer@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:287: undefined reference to `glDrawArrays@12'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget12pushGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:311: undefined reference to `glGetError@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:321: undefined reference to `glPushClientAttrib@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:322: undefined reference to `glPushAttrib@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:324: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:325: undefined reference to `glPushMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:326: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:327: undefined reference to `glPushMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:328: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:329: undefined reference to `glPushMatrix@0'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget11popGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:341: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:342: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:343: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:344: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:345: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:346: undefined reference to `glPopMatrix@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:348: undefined reference to `glPopClientAttrib@0'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:349: undefined reference to `glPopAttrib@0'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget13resetGLStatesEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:374: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:375: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:376: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:377: undefined reference to `glDisable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:378: undefined reference to `glEnable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:379: undefined reference to `glEnable@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:380: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:381: undefined reference to `glEnableClientState@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:382: undefined reference to `glEnableClientState@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:383: undefined reference to `glEnableClientState@4'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget16applyCurrentViewEv':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:419: undefined reference to `glViewport@16'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:422: undefined reference to `glMatrixMode@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:423: undefined reference to `glLoadMatrixf@4'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:426: undefined reference to `glMatrixMode@4'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget14applyBlendModeERKNS_9BlendModeE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:444: undefined reference to `glBlendFunc@8'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(RenderTarget.cpp.obj): In function `ZN2sf12RenderTarget14applyTransformERKNS_9TransformE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/RenderTarget.cpp:485: undefined reference to `glLoadMatrixf@4'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `checkMaximumTextureSize':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:66: undefined reference to `glGetIntegerv@8'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:72: undefined reference to `glGetIntegerv@8'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `ZN2sf7TextureD2Ev':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:124: undefined reference to `glDeleteTextures@8'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `ZN2sf7Texture6createEjj':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:166: undefined reference to `glGenTextures@8'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:214: undefined reference to `glBindTexture@8'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:215: undefined reference to `glTexImage2D@36'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:216: undefined reference to `glTexParameteri@12'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:217: undefined reference to `glTexParameteri@12'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:218: undefined reference to `glTexParameteri@12'
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:219: undefined reference to `glTexParameteri@12'
C:\Users\jaaga\Desktop\SFML\SFML-2.4.0\lib/libsfml-graphics-s-d.a(Texture.cpp.obj): In function `ZN2sf7Texture13loadFromImageERKNS_5ImageERKNS_4RectIiEE':
D:/sfml-release/_Sources/SFML/src/SFML/Graphics/Texture.cpp:270: undefined reference to `glFlush@0'
Process terminated with status 1 (0 minute(s), 5 second(s))
50 error(s), 0 warning(s) (0 minute(s), 5 second(s))
Yeah i know I am sorry, but as I don't even have an idea of whats going on I didn't know how to refrase it.
I tried doing what you said mbozzi but it didn't work...
I am using GNU GCC Compiler which I think is the compiler that comes with code::blocks.
I don't understand what does it mean to compile sfml from source code, could you explain?
Also I don't know what are the binaries. I downloaded and followed only these instructions (http://www.sfml-dev.org/tutorials/2.4/start-cb.php)
Make sure you download the binaries specifically for the exact version of the compiler you are using. Since you're using GCC, you'll need to know if you're using MINGW or TDM, since the binaries for one will not work with the other. The same goes for Visual Studio, etc.
You can compile SFML from source using your compiler of choice, but it isn't necessary since the binaries are provided for you, and there are supported compilers on major OSes.
Those instructions include (in a lovely red box so you won't miss it):
Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s or sfml-window-s-d for example, you will also have to link opengl32, winmm and gdi32. Some of these dependency libraries might already be listed under "Inherited values", but adding them again yourself shouldn't cause any problems.
And you are apparently not linking said dependencies, or providing them in the wrong order.