Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] Problem with SFML test code  (Read 2790 times)

0 Members and 1 Guest are viewing this topic.

Gakinhos

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED] Problem with SFML test code
« 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
« Last Edit: April 24, 2016, 07:57:14 am by Gakinhos »

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Problem with SFML test code
« Reply #1 on: April 24, 2016, 01:57:08 am »
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.

Gakinhos

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with SFML test code
« Reply #2 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)

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Problem with SFML test code
« Reply #3 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.

Gakinhos

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Problem with SFML test code
« Reply #4 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)
« Last Edit: April 24, 2016, 05:51:00 pm by Gakinhos »