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 - Alfonso1

Pages: [1]
1
General / undefined reference to `sf::SoundBuffer::SoundBuffer()'
« on: May 05, 2011, 12:33:43 am »
I dont know, when I try to compile it gives me these error.

obj\Debug\main.o||In function `Z9PlaySoundv':|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|17|undefined reference to `_imp___ZN2sf11SoundBufferC1Ev'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|18|undefined reference to `_imp___ZN2sf11SoundBuffer12LoadFromFileERKSs'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|24|undefined reference to `_imp___ZNK2sf11SoundBuffer11GetDurationEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|25|undefined reference to `_imp___ZNK2sf11SoundBuffer13GetSampleRateEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|26|undefined reference to `_imp___ZNK2sf11SoundBuffer16GetChannelsCountEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|29|undefined reference to `_imp___ZN2sf5SoundC1ERKNS_11SoundBufferEbffRKNS_7Vector3IfEE'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|30|undefined reference to `_imp___ZN2sf5Sound4PlayEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|39|undefined reference to `_imp___ZNK2sf5Sound16GetPlayingOffsetEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|33|undefined reference to `_imp___ZNK2sf5Sound9GetStatusEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|41|undefined reference to `_imp___ZN2sf5SoundD1Ev'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|41|undefined reference to `_imp___ZN2sf5SoundD1Ev'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|41|undefined reference to `_imp___ZN2sf11SoundBufferD1Ev'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|41|undefined reference to `_imp___ZN2sf11SoundBufferD1Ev'|
obj\Debug\main.o||In function `Z9PlayMusicv':|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|52|undefined reference to `_imp___ZN2sf5MusicC1Ej'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|53|undefined reference to `_imp___ZN2sf5Music12OpenFromFileERKSs'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|58|undefined reference to `_imp___ZNK2sf5Music11GetDurationEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|59|undefined reference to `_imp___ZNK2sf11SoundStream13GetSampleRateEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|60|undefined reference to `_imp___ZNK2sf11SoundStream16GetChannelsCountEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|63|undefined reference to `_imp___ZN2sf11SoundStream4PlayEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|72|undefined reference to `_imp___ZNK2sf11SoundStream16GetPlayingOffsetEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|66|undefined reference to `_imp___ZNK2sf11SoundStream9GetStatusEv'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|74|undefined reference to `_imp___ZN2sf5MusicD1Ev'|
C:\Documents and Settings\Administrador\Mis documentos\asd\Prueba\main.cpp|74|undefined reference to `_imp___ZN2sf5MusicD1Ev'|
||=== Build finished: 23 errors, 0 warnings ===|

the code is these:

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Audio.hpp>
#include <iomanip>
#include <iostream>


////////////////////////////////////////////////////////////
/// Play a sound
///
////////////////////////////////////////////////////////////
void PlaySound()
{
    // Load a sound buffer from a wav file
    sf::SoundBuffer Buffer;
    if (!Buffer.LoadFromFile("datas/sound/footsteps.wav"))
        return;


    // Display sound informations
    std::cout << "footsteps.wav :" << std::endl;
    std::cout << " " << Buffer.GetDuration()      << " sec"           << std::endl;
    std::cout << " " << Buffer.GetSampleRate()    << " samples / sec" << std::endl;
    std::cout << " " << Buffer.GetChannelsCount() << " channels"      << std::endl;

    // Create a sound instance and play it
    sf::Sound Sound(Buffer);
    Sound.Play();

    // Loop while the sound is playing
    while (Sound.GetStatus() == sf::Sound::Playing)
    {
        // Leave some CPU time for other processes
        sf::Sleep(0.1f);

        // Display the playing position
        std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Sound.GetPlayingOffset() << " sec   ";
    }
    std::cout << std::endl << std::endl;
}


////////////////////////////////////////////////////////////
/// Play a music
///
////////////////////////////////////////////////////////////
void PlayMusic()
{
    // Load an ogg music file
    sf::Music Music;
    if (!Music.OpenFromFile("datas/sound/lepidoptera.ogg"))
        return;

    // Display music informations
    std::cout << "lepidoptera.ogg :" << std::endl;
    std::cout << " " << Music.GetDuration()      << " sec"           << std::endl;
    std::cout << " " << Music.GetSampleRate()    << " samples / sec" << std::endl;
    std::cout << " " << Music.GetChannelsCount() << " channels"      << std::endl;

    // Play it
    Music.Play();

    // Loop while the music is playing
    while (Music.GetStatus() == sf::Music::Playing)
    {
        // Leave some CPU time for other processes
        sf::Sleep(0.1f);

        // Display the playing position
        std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Music.GetPlayingOffset() << " sec   ";
    }
    std::cout << std::endl;
}


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Play a sound
    PlaySound();

    // Play a music
    PlayMusic();

    // Wait until the user presses 'enter' key
    std::cout << "Press enter to exit..." << std::endl;
    std::cin.ignore(10000, '\n');

    return EXIT_SUCCESS;
}


it is the audio sample

2
General / undefined reference to `sf::SoundBuffer::SoundBuffer()'
« on: May 04, 2011, 09:20:33 pm »
is these the official totorial?

Tutorial - Getting started - SFML and Code::Blocks (MinGW)
http://www.sfml-dev.org/tutorials/1.6/start-cb.php

yes I had read it, but I can't link the library

3
General / undefined reference to `sf::SoundBuffer::SoundBuffer()'
« on: May 04, 2011, 08:29:01 pm »
I am using Windows XP and code::block

when I load some sample (for example the "sound" sample) and try to compile it, it geves me an error

undefined reference to `sf::SoundBuffer::SoundBuffer()'

what can i do?

4
General / SFML dont work in Code::Blocks
« on: May 04, 2011, 05:46:12 pm »
I search the library but it isn't in my mingw carpet or codeblock carpet or sfml carpet, neither in the sub carpets

5
General / SFML dont work in Code::Blocks
« on: May 04, 2011, 05:02:52 am »
I put the library sfml-system.dll, but now it said me that doesn't find "libgcc_s_dw2-1.dll"

and that library is not in the package I downloaded

6
General / SFML dont work in Code::Blocks
« on: May 04, 2011, 02:44:29 am »
I had download codeblocks-10.05mingw-setup.exe form here:
http://www.codeblocks.org/downloads/26

and I had dowload SFML for Windows - MinGW (Code::Blocks) (34.4 MB)
from here:
http://www.sfml-dev.org/download.php

and I had follow the steps of these totorial:
Tutorial - Getting started - SFML and Code::Blocks (MinGW)
http://www.sfml-dev.org/tutorials/1.6/start-cb.php

and try to compile and execute the example code in that totorial, but it give me an error, it said me that doesn't find "sfml-system.dll"

how can I repare these error?

7
General / SFML dont work in devcpp
« on: May 02, 2011, 08:57:14 pm »
I am working with dev cpp

I download Windows - MinGW (Code::Blocks) (34.4 MB) from here
http://www.sfml-dev.org/download.php

beacuse I think that the IDE devcpp use the compiler MinGW, ¿is these correct?

Quote
You must link the libraries


I dont know how, I said:
Quote
in the project opcions I had put:
the direction of SFML-1.6\lib in "Library directories"
and the direction of SFML-1.6\include in "Include derectories"

but that doesn't work

Quote
until now you have only specified where the libraries are, but not which libraries to use.


How can I do these?

thank for the reply and sorry for my writing (The english is not my lenguage)

8
General / SFML dont work in devcpp
« on: May 02, 2011, 08:01:51 pm »
I had download Windows - MinGW (Code::Blocks) (34.4 MB)

and in the project opcions I had put:
the direction of SFML-1.6\lib in "Library directories"
and the direction of SFML-1.6\include in "Include derectories"

but when I try to compile it geves me an error:

[Linker error] undefined reference to `sf::Clock::Clock()'

the code is these:

Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}

Pages: [1]