SFML community forums

Help => Audio => Topic started by: iHope on January 02, 2012, 09:55:02 am

Title: SFML 1.6 Audio problem
Post by: iHope on January 02, 2012, 09:55:02 am
So, could anyone help with this problem? Im trying to play music in my app, but I always get something like this. I tried that code in "Playing music" tutorial, but again something like this. I have no idea why it doesn't work. Oh, right I'm using Xcode 3.2

Undefined symbols:
  "sf::Music::Music(unsigned long)", referenced from:
      _main in main.o
  "sf::SoundStream::Stop()", referenced from:
      _main in main.o
  "sf::SoundStream::Play()", referenced from:
      _main in main.o
      _main in main.o
  "sf::Music::~Music()", referenced from:
      _main in main.o
      _main in main.o
  "sf::Music::OpenFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::SoundStream::GetStatus() const", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Sorry about my bad english...
Title: SFML 1.6 Audio problem
Post by: Nexus on January 02, 2012, 11:04:56 am
Did you link sfml-audio(-s)(-d)? You need the -s for static linkage and the -d for the debug configuration, and both if you combine them.

And for static linkage in SFML 2, you have to define SFML_STATIC. In SFML 1, the macro SFML_DYNAMIC is required for dynamic linkage.
Title: SFML 1.6 Audio problem
Post by: iHope on January 02, 2012, 12:01:03 pm
Sorry, but I don't know how to link in Xcode 3.2  :D
If you(anyone) could give any kind of instructions for that I would be really grateful.
Title: SFML 1.6 Audio problem
Post by: Nexus on January 02, 2012, 01:07:10 pm
There's a tutorial on the SFML homepage...
Title: SFML 1.6 Audio problem
Post by: iHope on January 02, 2012, 01:26:17 pm
Could you please put a link to there. I know, I'm pathetic 'cause I can't find the tutorial.
Title: SFML 1.6 Audio problem
Post by: Nexus on January 02, 2012, 01:40:19 pm
Tutorials -> Tutorials for version 1.6 -> Getting started -> SFML and Xcode (Mac OS X) :)
Title: SFML 1.6 Audio problem
Post by: iHope on January 02, 2012, 01:56:21 pm
Thx a lot man!  :D
Never expected to get a answer to my question today. Dude, you saved my day.