Error loading audio to SFML

Asked

Viewed 7 times

0

My IDE is Clion when I try to open an audio file that way:

Music menuMusic;
if (!menuMusic.openFromFile("menu.wav")) return EXIT_FAILURE;

It provides the this error: Failed to open sound file "menu.wav" (couldn't open stream)

This is my CMakeLists.txt

cmake_minimum_required(VERSION 3.17)
project(Enforcados)

set(CMAKE_CXX_STANDARD 17)
find_package(SFML 2.5 COMPONENTS graphics audio)

add_executable(Enforcados main.cpp)

target_link_libraries(Enforcados sfml-graphics sfml-audio)

When I compile manually using g++ main.cpp -o sfml-app -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system he does not make any mistake. What I am leaving to put?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.