Hello everyone,
I currently have a problem running sounds with SFML. I'm currently working on my end year project for studies and i'm working on c++ with SFML library.
SFML works fine excepted the sounds, when i try to play a sound with SFML, i get the following message:
"The program can't start because sfml-window-d-2-dll is missing".
I can get rid of this message by putting the dll's in the project folder, but i want it running well without putting theses dll's in the project folder (because when i will compress the file, i will have to remove the file where these dll's are).
My project is a Cmake project, and here the CMakeLists file:
cmake_minimum_required (VERSION 3.15)
project (oop2_project)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
if (MSVC)
add_compile_options (/W4 /permissive- /Zc:externConstexpr /Zc:inline)
endif ()
link_directories("c:/SFML/SFML-2.5.1/lib")
add_executable (oop2_project WIN32 "")
add_subdirectory (include)
add_subdirectory (src)
add_subdirectory (resources)
set (SFML_STATIC_LIBRARIES TRUE)
set (SFML_DIR "C:/SFML/SFML-2.5.1/lib/cmake/SFML")
find_package (SFML 2.5 COMPONENTS graphics REQUIRED)
set_target_properties (sfml-main sfml-system sfml-window sfml-graphics sfml-audio sfml-network PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE)
target_link_libraries (oop2_project sfml-graphics sfml-main)
How can i link the dll in the CMakeLists file ?
Some help would be appreciated.
Thank you very much !