Trouble with sfml installation

Hey, I've got problem with SFML install into CodeBlocks. I installed it just how they write on http://www.sfml-dev.org/tutorials/2.1/start-cb.php
Then I copied their code into my main.cpp and it threw me errors down below. So I deleted all files of sfml and configuration (I just did by tutorial) in code blocks. Then I re-downloaded sfml and installed and configurated it again. When that failed, just to make sure there's no problem with code blocks I uninstalled it and deleted everything connected to code blocks and sfml. And then everything installed again.

I don't know why it doesn't work, but it always throws at me this build messages:

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
obj\Debug\test.o||In function `main':|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|5|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|5|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|6|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|7|undefined reference to `_imp___ZN2sf5Color5GreenE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|7|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|15|undefined reference to `_imp___ZN2sf6Window5closeEv'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|12|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|18|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|18|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|19|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|19|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|20|undefined reference to `_imp___ZN2sf6Window7displayEv'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|9|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Users\Štěpán\Desktop\newOne\test\test.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
obj\Debug\test.o||In function `ZN2sf11CircleShapeD1Ev':|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'|
||=== Build failed: 19 error(s), 0 warning(s) (0 minute(s), 24 second(s)) ===|
Last edited on
Are you linking dynamic or static?
Are you linking in right order?
I wrote nothing to the '#defines' in setting configuration, so it should be dynamic (that's what they write is default)
I'm doing it just how it's in the tutorial, so I have it in order: graphics, window, system
and they are for debug sfml-system-d, sfml-window-d and sfml-graphics-d and for release they are without the -d?
yes, they are

EDIT: The very first time I tried to install I did not have there -d at Debug, now I have and it's the same error.
Last edited on
Okay, I tried it with static settings (by the tutorial) and still seems to be the same error.
So can't it be somewhere in code blocks? To me it seems that it can't find way to the sfml. (I also tried starting sfml project - and nothing has changed)
Last edited on
Still troubleshooting undefined reference.
Did you place all the sfml dll's in your programs bin/debug folder? At least the ones that your app uses? I used to have a very similar problem with getting mine installed. That was my issue.
Still the same undefined reference. But thanks - I had not those files in there ;)
Last edited on
Okay, in that case. Try going to this link as it is where I made my original post on the sfml forums to get mind working. You may have an outdated version like I did. Try the nightly build mentioned in the posts there.
http://en.sfml-dev.org/forums/index.php?topic=16214.msg116089#msg116089
Thank you so much! Firstly it was throwing at me error, that it can't run properly - then I realised I have to re-copy all the dll's to the Debug folder of my project and it worked!

P.S. They should really make the tutorial better for beginners:)
Topic archived. No new replies allowed.