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

Pages: [1]
1
Audio / Re: [SFML] Audio file won't load
« on: January 12, 2013, 10:45:05 am »
Ohh, sorry, I've misunderstood.
Code: [Select]
The console shows the following error: "Failed to open sound file "mainMusic.wav" (file contains data in an unknown format).
Error while loading music.

That is pretty strange, the file has 'Wave' type (.wav). I will download another .wav file and test if it works.
Update: Oh my god, yes, the 'mainMusic.wav' was somehow corrupted. Thank you very much guys! The console really helped me.

2
Audio / Re: [SFML] Audio file won't load
« on: January 12, 2013, 09:56:30 am »
Hello sir.

I have checked it.
Code: [Select]
C:\Users\Brukmoon\Documents\Visual Studio 2010\Projects\SFML\Release
In this directory I have everything, the DLLs, the 'mainMusic.wav' and the application. I will test the application on another computer.
I would like to thank you all for trying to help me. I really appreciate it.

PS: I have also tried the sf::Music. It did not work either.
UPDATE: I have tried to run the application on my second computer and it did not work there either.

3
Audio / Re: [SFML] Audio file won't load
« on: January 12, 2013, 08:48:53 am »
Hello.

Yes, I have put all the DLLs into the folder with my .exe application.
As I've stated before the application compiles and links well, no errors/warning at all, build successful. It just won't open the file even thought it should.

4
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

5
General / Re: Unable to compile a SFML project [Visual Studio C++ Express]
« on: September 15, 2012, 12:22:10 pm »
I have fixed it, I am sorry for wasting your bandwidth. I just had to add -s postfix after the libs names, because I have set the SFML_STATIC preprocessor directive.
But, I am getting one simple warning:
Code: [Select]
1>------ Build started: Project: SFtest, Configuration: Release Win32 ------
1>  main.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>  Generating code
1>  Finished generating code
1>  SFtest.vcxproj -> c:\users\brukmoon\documents\visual studio 2010\Projects\SFtest\Release\SFtest.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
how to fix it?

6
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]
anything