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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rtm5

Pages: [1]
1
Audio / Re: Unable to play music
« on: October 07, 2015, 05:49:54 pm »
Thanks - Can you point me to any resources that can teach me this specific technique? I'm doing a bit of research on my end, and I am noticing that some use a while loop afterwards to keep the music playing (not sure if this is technically correct).

2
Audio / Unable to play music
« on: October 07, 2015, 03:36:38 pm »
Hi all,

I'm struggling with trying to play music from my console, and I am not sure what the problem is. This is the current code:

#include <iostream>
#include <string>
#include <SFML/Audio/Music.hpp>

int main(int argc, char* argv[])
{
  sf::Music music;

  if (!music.openFromFile("recit24bit.flac"))
  {
    std::cout << "Error" << std::endl;
    return -1;
  }

  music.play();
 
  return 0;
}

I compile the file like so: g++ main.cpp -o music-app -lsfml-audio -lsfml-system

The flac file plays on my media player, so I'm not sure what the problem is, and it's located in the same directory as the executable.

I'm using g++ 4.8.4, ubuntu 14.04 LTS, and I downloaded the SMFL package through the debian package handler.

Thanks

3
Audio / Re: Undefined reference to 'sf::Music::Music()'
« on: October 05, 2015, 01:10:39 am »
Thanks for the helpful links, I got it working!

4
Audio / Undefined reference to 'sf::Music::Music()'
« on: October 04, 2015, 10:40:46 pm »
Hi All,

I am very new to programming, and I am attempting to create a simple audio player. I am getting an error message when I try and compile the following code:

#include <SFML/Audio/Music.hpp>

int main(int argc, char* argv[])
{
     sf::Music music;
     
      return 0;
}


I'm compiling like so:

g++ main.cpp -o main

Here is the error message:

/tmp/ccOEn1HF.o: In function `main':
main.cpp:(.text+0x24): undefined reference to `sf::Music::Music()'
main.cpp:(.text+0x38): undefined reference to `sf::Music::~Music()'
collect2: error: ld returned 1 exit status

Not sure what the problem is!?

Pages: [1]