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

Author Topic: [FIXED]Undefined reference to sf::Thread::~Thread()  (Read 2822 times)

0 Members and 1 Guest are viewing this topic.

pozioxd

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
[FIXED]Undefined reference to sf::Thread::~Thread()
« on: September 26, 2014, 02:33:35 pm »
Hello good people from SFML forums.

Today I wanted to add some music into my project, and what happened?

||=== Build: Debug in Right Strike (compiler: GNU GCC Compiler) ===|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStreamD2Ev':|
D:\developpement\sfml\sfml\src\SFML\Audio\SoundStream.cpp|56|undefined reference to `sf::Thread::~Thread()'|
D:\developpement\sfml\sfml\src\SFML\Audio\SoundStream.cpp|56|undefined reference to `sf::Thread::~Thread()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream4playEv':|
D:\developpement\sfml\sfml\src\SFML\Audio\SoundStream.cpp|105|undefined reference to `sf::Thread::launch()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream4stopEv':|
D:\developpement\sfml\sfml\src\SFML\Audio\SoundStream.cpp|121|undefined reference to `sf::Thread::wait()'|
C:\SFML-2.1\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj)||In function `ZN2sf11SoundStream16setPlayingOffsetENS_4TimeE':|
D:\developpement\sfml\sfml\src\SFML\Audio\SoundStream.cpp|164|undefined reference to `sf::Thread::launch()'|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
 

This thing!

#BIG EDIT:
I'm stupid. You need to order your libs like: audio, graph, window, system, and my libs were like graph, window, system, audio.


« Last Edit: September 26, 2014, 03:13:09 pm by pozioxd »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Sounds like your link order is wrong. However its best if you read the following link and give all the info. Oh, and mention what compiler you are using and where you got SFML.

http://en.sfml-dev.org/forums/index.php?topic=12552.0
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

pozioxd

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
-------------- Build: Debug in Right Strike (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\SFML-2.1\lib -LC:\SFML-2.1\lib -o "bin\Debug\Right Strike.exe" obj\Debug\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-audio-s-d
C:\SFML-2.1\lib/libsfml-audio-s-d.a(SoundStream.cpp.obj): In function `ZN2sf11SoundStreamD2Ev':
D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp:56: undefined reference to `sf::Thread::~Thread()'
D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp:56: undefined reference to `sf::Thread::~Thread()'
C:\SFML-2.1\lib/libsfml-audio-s-d.a(SoundStream.cpp.obj): In function `ZN2sf11SoundStream4playEv':
D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp:105: undefined reference to `sf::Thread::launch()'
C:\SFML-2.1\lib/libsfml-audio-s-d.a(SoundStream.cpp.obj): In function `ZN2sf11SoundStream4stopEv':
D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp:121: undefined reference to `sf::Thread::wait()'
C:\SFML-2.1\lib/libsfml-audio-s-d.a(SoundStream.cpp.obj): In function `ZN2sf11SoundStream16setPlayingOffsetENS_4TimeE':
D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp:164: undefined reference to `sf::Thread::launch()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
5 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
I got code::blocks with default compiler (GNU GGC). I tried to redownload SFML 2.1, but this didn't fix the problem. Graphics- window- system- audio - that's my linking order. And according to tutorial on official SFML site it's good.

In this code there's "D:/developpement/sfml/sfml/src/SFML/Audio/SoundStream.cpp" isn't that weird? Because I don't have D:/ partition.

pozioxd

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
NVM IM STUPID. SORRY GUYS FOR TAKING YOUR TIME...
Linking order goes from non-core, to core(system). Now I understand this :D
Sorry for my stupidity

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10896
    • View Profile
    • development blog
    • Email
AW: [FIXED]Undefined reference to sf::Thread::~Thread()
« Reply #4 on: September 26, 2014, 11:59:59 pm »
You can also think of it like X sfml-graphics depends on sfml-window which depends on sfml-systrm, etc. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything