SFML community forums

Help => General => Topic started by: Gakinhos on April 24, 2016, 01:12:27 am

Title: [SOLVED] Problem with SFML test code
Post by: Gakinhos on April 24, 2016, 01:12:27 am
So I installed SFML and tried to compile the test code but I had a problem building it, I tried to search how to fix it on the internet but I can't find it... I'll leave here images with the problems I have when I try to build it. (I'm using CodeBlocks)

http://prntscr.com/aw0xus
http://prntscr.com/aw0xwt
http://prntscr.com/aw0xyi
Title: Re: Problem with SFML test code
Post by: G. on April 24, 2016, 01:57:08 am
Quote from: http://www.sfml-dev.org/tutorials/2.3/start-cb.php
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.
I tried to search how to fix it on the internet but I can't find it... I'll leave here images with the problems I have when I try to build it.
Maybe they also left "images with the problems they had" so that nobody could find the answer with a search engine.
Title: Re: Problem with SFML test code
Post by: Gakinhos on April 24, 2016, 02:32:32 am
http://prnt.sc/aw1mtk

Is that right? Sorry if I did a dumb mistake but I'm new into this stuff... (I keep getting the error)
Title: Re: Problem with SFML test code
Post by: Spirro on April 24, 2016, 06:54:58 am
http://prnt.sc/aw1mtk

Is that right? Sorry if I did a dumb mistake but I'm new into this stuff... (I keep getting the error)

You make no mention of your OS or compiler.  If you are using Visual Studios then that linking order should be ok, but if you are using MinGW as a compiler it probably won't work.  Review these pages as they list the dependencies of each SFML module:
http://www.sfml-dev.org/tutorials/2.3/start-vc.php
and
http://www.sfml-dev.org/tutorials/2.3/start-cb.php

You may need to shift your linking order to get things to compile correctly.  If you want better explanations to your issues then follow this guide:
http://en.sfml-dev.org/forums/index.php?topic=5559.0
or perhaps one more knowledgeable than me can link to.
Title: Re: Problem with SFML test code
Post by: Gakinhos on April 24, 2016, 07:55:40 am
YES! I actually got it to work, took me quite a while but now I kinda understand, thanks, you guys helped me a lot :) (Btw I was using CodeBlocks)