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

Author Topic: Audio Doesn't Seem to be Linking?  (Read 3665 times)

0 Members and 1 Guest are viewing this topic.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Audio Doesn't Seem to be Linking?
« on: September 21, 2010, 09:21:15 am »
Hello, everybody.

I'm trying to incorporate the use of the SFML audio package in a little testing application I've put together. Here's the code for the actual program:

Code: [Select]

#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>

int main()
{
    // Create main window
    sf::RenderWindow App(sf::VideoMode(640, 480), "SFML Graphics");

sf::SoundBuffer spitBuffer;
spitBuffer.LoadFromFile("Memo.wav");

sf::Sound spit(spitBuffer);
float pitchCount = 1;

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear screen
        App.Clear();
pitchCount += .01;

spit.SetPitch(pitchCount);

spit.Play();

        // Draw apredefined shape
        App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));

        // Finally, display the rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


And here's what I get from my IDE (Xcode):

Line Location Tool:0: collect2: ld returned 1 exit status
Line Location Tool:0: symbol(s) not found
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::Sound::SetPitch(float)", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::SoundBuffer::SoundBuffer()", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::Sound::Play()", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::SoundBuffer::~SoundBuffer()", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::SoundBuffer::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: "sf::Sound::~Sound()", referenced from:

No idea exactly what this means, but I'm assuming it has to do with a linking problem. However, there are no errors with the rest of the code that has to do with the SFML library; in fact, without the Audio package functions and whatnot, the program will run fine and render the circle included in the program. I made sure the .wav file used in the program is also in the right place and everything. I would greatly appreciate some help on how to fix this problem :] I am running Mac OS 10.5.

Thanks in advance!

Colton[/code]
Whether you think you can or you can't, you're right.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Audio Doesn't Seem to be Linking?
« Reply #1 on: September 21, 2010, 09:40:48 pm »
Nevermind, I found the answer! :p I wasn't linking to the libraries in Xcode that deal with audio.... foolish, foolish, foolish :/ But thanks to y'all anyway :]
Whether you think you can or you can't, you're right.

 

anything