Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: "The program can't start because sfml-window-d-2-dll is missing"  (Read 4217 times)

0 Members and 1 Guest are viewing this topic.

Koga

  • Newbie
  • *
  • Posts: 1
    • View Profile
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.  ;D

Thank you very much !
« Last Edit: June 16, 2021, 03:24:01 am by Koga »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: "The program can't start because sfml-window-d-2-dll is missing"
« Reply #1 on: June 16, 2021, 08:29:02 am »
Here's an example CMake file on how to use SFML: https://en.sfml-dev.org/forums/index.php?topic=24070.0

For audio, you can't get around providing the OpenAL DLL due to LGPL licensing.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/