SFML community forums

Help => Audio => Topic started by: Fungiy on June 06, 2019, 11:08:51 am

Title: Compilation errors with music.hpp
Post by: Fungiy on June 06, 2019, 11:08:51 am
Hello!

I am trying to install SFML into my already existing old SFML project. However, after following the tutorial I received these compiler errors after build:

'{': no matching token found -> line 49

syntax error: ')' -> line 75

syntax error: 'constant' -> line 75

syntax error: missing ';' before 'constant' -> line 75

unexpected token (s) preceding ':'; skipping apparent function body -> line 75

All errors come from the music.hpp file.

I already tried all 3 different versions of SFML. vs12 vs14 and vs15. 32 bit for all.

I'm running windows10 as my os

If anyone had similar problems I would love to know! Thanks!
Title: Re: Compilation errors with music.hpp
Post by: Laurent on June 06, 2019, 11:33:51 am
Hi

Does a cpp file containing just this, produces the errors?
#include <SFML/Audio/Music.hpp>

If so, you'll have to tell us in details what you did to install SFML. If not, then please provide a complete and minimal code that reproduces the problem.
Title: Re: Compilation errors with music.hpp
Post by: Fungiy on June 07, 2019, 01:24:32 am
Thanks for the reply.

I did not find an instance in my code where I included that file specifically.
I included Audio.hpp however.

I attached a couple of screenshots of my setup. Can you tell me if I installed it correctly?

I did include the SFML_STATIC; macro
Title: Re: Compilation errors with music.hpp
Post by: Laurent on June 07, 2019, 08:05:42 am
Please answer the questions instead of posting tons of irrelevant details ;)

Quote
Does a cpp file containing just this, produces the errors?
#include <SFML/Audio/Music.hpp>
That meant: try it!

And then, depending on the result (compiles or not):
Quote
If so, you'll have to tell us in details what you did to install SFML. If not, then please provide a complete and minimal code that reproduces the problem.
Title: Re: Compilation errors with music.hpp
Post by: eXpl0it3r on June 07, 2019, 08:35:00 am
Probably not causing any issues, but do you really need to link SFML and SDL at the same time.
Also if you link SFML statically, you have to link SFML's dependencies as well.