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

Pages: [1]
1
Audio / Can't play MP3s with <SFML/Audio>?
« on: July 25, 2014, 08:49:02 pm »
So, first I'll post the code, then explain:

#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <Windows.h>

int main()
{
        ShowWindow(GetConsoleWindow(), SW_HIDE);
        sf::Music music;
        if (!music.openFromFile("C:\Users\Public\Music\Sample Music\Kalimba.mp3"))
                return -1; // error
        music.play();
        return 0;
}

I am using Visual Studio 2013 Express, and when I run this program, I get an irritating beeping noise and get this message:
Quote
Unhandled exception at 0x0F26DEF8 (msvcr110.dll) in sfmoDemo.exe: 0xC0000005: Access violation reading location 0x00297000.

I don't really know what that means. Is there anything wrong with the code? I got it from the resources page - http://www.sfml-dev.org/tutorials/2.1/audio-sounds.php - so I assume it isn't that. Is there a way that I setup SFML wrong? I'd appreciate any help I can get! Thanks!

2
Window / Re: Help with creating a window?
« on: June 17, 2014, 11:28:49 pm »
I have the dynamic files. Here is the .pro file:
Code: [Select]

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp

LIBS += -LC:/SFML/lib

CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-network -lsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-main-d -lsfml-network-d -llibsfml-window-d -lsfml-system-d
CONFIG += c++11
INCLUDEPATH += C:/SFML/include
DEPENDPATH += C:/SFML/include

Also, as I said somewhere at the top, I am using Qt Creator. SFML 2.1, and on Windows.

3
Window / Re: Help with creating a window?
« on: June 16, 2014, 04:28:23 pm »
I added it in there (after the nested while loop, inside while(window.isOpen()) and still, nothing

4
Window / Re: Help with creating a window?
« on: June 06, 2014, 08:39:25 pm »
Ok, well the Console window comes up, but I don't get anything for the SFML window. I looked at the SFML 2 tutorial, and I still couldn't get it fixed. The compiler also will say "cannot optain handle to inferior. Parameter incorrect". It doesn't come up as an error, though, it comes up as a warning.

5
Window / Re: Help with creating a window?
« on: June 06, 2014, 05:24:15 pm »
Oh, I meant the code example at the top of the webpage I linked to. I am completely new to this. Anybody know how to fix the code?

6
Window / Help with creating a window?
« on: June 06, 2014, 04:56:04 pm »
So, I finally got SFML to work, and I am trying to use the tutorials on the site
http://sfml-dev.org/tutorials/1.6/window-window.php

Well, the code at the top doesn't work for me. Am I missing something? My code:

#include <iostream>
#include <SFML/Window.hpp>
using namespace std;

int main(int argc, char** argv)
{
    sf::Window window(sf::VideoMode(800, 600, 32), "SFML Window");
   
    while(window.isOpen()){
        sf::Event event;
        while(window.pollEvent(event)){

            if(event.type == sf::Event::Closed){
                window.close();
            }
        }
    }

    return 0;
}


 

Pages: [1]