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

Pages: [1]
1
Audio / Re: SFML Audio keeps giving errors
« on: July 28, 2015, 04:16:10 am »
idk what I did wrong but I guess I mistyped what you told me to change in the linker settings. I LOVE YOU SO MUCH FOR HELPING ME. and the reason I used the wrong file format was just to test if that was the issue lol ;D ;D ;D

2
Audio / Re: SFML Audio keeps giving errors
« on: July 21, 2015, 03:54:05 am »
sorry about the other website issue, I had not been, and still have not, been given an adequate answer on that site and figured that the best place to get an answer for a SFML question would be on its own site. Anyways, I reordered it as you said and nothing changed, same errors, same sad me

3
Audio / SFML Audio keeps giving errors
« on: July 19, 2015, 08:39:32 pm »
I have sfml installed to my codeblocks, and the graphics part has been working great. I'm following some youtube tutorials that just covered audio, yet when I try running the code that I am taught, I get a ton of errors. I've spent so many hours looking for a solution to this; I REALLY need some help right now and would appreciate anything

Here's my code:

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

int main(){ //IMPORTANT: use .wav files for sound effects, and use .ogg files for long background songs etc.

    sf::Vector2i screenDimensions(800,600);

    sf::RenderWindow Window;
    Window.create(sf::VideoMode(screenDimensions.x, screenDimensions.y), "A Window");

    sf::Clock clock;

    sf::SoundBuffer soundBuffer;
    sf::Sound sound;

    if(!soundBuffer.loadFromFile("punch.ogg")){
        std::cout << "Can't find audio file" << std::endl;
    }

    sound.setBuffer(soundBuffer);

    float moveSpeed = 10000.0f;

    while(Window.isOpen()){

        clock.restart();
        sf::Event Event;
        while(Window.pollEvent(Event)){

            switch(Event.type){
            case sf::Event::Closed:
                Window.close();
                break;
            case sf::Event::KeyPressed:
                if(Event.key.code == sf::Keyboard::Escape){
                    Window.close();
                }
                if(Event.key.code == sf::Keyboard::P){
                    sound.play(); //there's also sound.pause(), that is resumed with play(), but also sound.stop() that resets the sound when next played
                }
                break;
            }
        }

        Window.display();
        Window.clear();
        }
}

Here's all of the linker settings (I've done the #define's and the other stuff so I don't think the issue could actually be that)

sfml-audio-s-d
sfml-network-s-d
sfml-graphics-s-d
sfml-window-s-d
sfml-system-s-d
flac
ogg
vorbis
vorbisenc
vorbisfile
openal32
jpeg
freetype
ws2_32
gdi32
opengl32
winmm

And lastly, all of the wonderful errors:

E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_write' follow|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_readinit'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_readinit'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_read' follow|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_read' follow|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeinit'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeclear'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeclear'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeinit'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_write' follow|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_reset'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeclear'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_reset'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
E:\CODING STUFF FOR C++\zzz.External Libraries\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (0 minutes, 2 seconds) ===|

Pages: [1]