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

Author Topic: SFML not linking properly  (Read 1124 times)

0 Members and 1 Guest are viewing this topic.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
SFML not linking properly
« on: August 02, 2013, 10:50:50 pm »
Good day,
I switched to SFML 2.1 today (which was apparently a bugfix). All I did was essentially a drop-in replacement of the SFML files (include folders, .a files and .dll files).

Before describing my error, I'm specify that I'm on Windows 7 x64 with MinGW 4.8.1 DW2 x32.

So, I compiled myself, replaced the files, then went ahead to compile my jam project, only to get
C:\Users\Aster\AppData\Local\Temp\ccXM3Mrx.o:main.cpp:(.text+0x9c): undefined reference to `_imp___ZN2sf6SpriteC1Ev'
For every single SFML thing I use, I get this error. From every module.

I compile with this:
g++ -std=c++11 -Wall -lsfml-graphics -lsfml-window -lsfml-system main.cpp Game/Game.cpp -osfml-jam

I've tried using SFML's precompiled binaries. I upgraded MinGW from 4.8.0 to 4.8.1. I rebooted.

I have no idea why this is happening, any help would be greatly appreciated. Thanks!
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10226
    • View Profile
    • development blog
    • Email
Re: SFML not linking properly
« Reply #1 on: August 02, 2013, 11:31:56 pm »
You need to specify the source code files first and then link against the libraries. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
Re: SFML not linking properly
« Reply #2 on: August 02, 2013, 11:32:55 pm »
Aaah, right! I don't know how many times I've fallen for that! Thanks so much!
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net