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.


Topics - Brukmoon

Pages: [1]
1
Audio / [SFML] Audio file won't load
« on: January 11, 2013, 09:21:33 pm »
Hello dear SFML programmers,

I am having an issue which I have been trying to resolve the past few days. I am not able to load/play music files.
Example:
Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

int main()
{
sf::RenderWindow window(sf::VideoMode(sf::VideoMode::getDesktopMode()), "SFML");
sf::SoundBuffer buffer;
    if (!buffer.loadFromFile("mainMusic.wav"))
        return -1;
sf::Sound sound;
sound.setBuffer(buffer);
sound.play();
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
window.close();
}
}
}

The program immediately closes therefore it is obvious that the sound file "mainMusic.wav" does not open.
Yes, the .wav file exists. I have all needed .dll files. I am running the SFML 2.0 version, Windows 7. I have included the .lib files for dynamic linkage.
Could you, please, help me?
Thank you in advance.

Sincerely yours,
Brukmoon

2
General / Unable to compile a SFML project [Visual Studio C++ Express]
« on: September 15, 2012, 12:14:43 pm »
Greetings.

I am having issues compiling a C++ SFML project using Visual Studio 2010 Express Edition. This is my first time using the SFML library.
I have followed the tutorial on how to set up SFML on VS. (http://www.sfml-dev.org/tutorials/2.0/start-vc.php)
I am using SFML 2.0.
The library seem to be added, the compiler does not show any compile errors, only two linking errors.
This is the output that the compiler shows when I compile the project [release]:
Code: [Select]
1>------ Build started: Project: SFtest, Configuration: Release Win32 ------
1>  main.cpp
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>c:\users\brukmoon\documents\visual studio 2010\Projects\SFtest\Release\SFtest.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I would appreciate any help. Thank you in advance.

Sincerely,
Brukmoon

Pages: [1]