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

Author Topic: Can't find sfml DLLs  (Read 2399 times)

0 Members and 2 Guests are viewing this topic.

HighOnComunism

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Can't find sfml DLLs
« on: April 12, 2020, 09:58:58 pm »
Hey there,

I'm trying to run a simple program using SFML, it has been done without any issues on Linux but can't get it to work on Windows.

I've tried placing the DLLs in the same directory as the executable, but still no success.

This is my cmake:

cmake_minimum_required(VERSION 3.5)

project(QuadTreeCulling)

cmake_policy(SET CMP0074 NEW)

add_executable(QuadTreeCulling main.cpp)

target_compile_features(QuadTreeCulling PRIVATE cxx_std_17)

target_include_directories(QuadTreeCulling
    PUBLIC
        $<INSTALL_INTERFACE:include>    
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}../../include>
    PRIVATE
                ${CMAKE_CURRENT_SOURCE_DIR}/../../source/
)

target_link_libraries(QuadTreeCulling
        PUBLIC
                ${CMAKE_CURRENT_SOURCE_DIR}/../../SFML/Windows/sfml-graphics-d-2.dll
                ${CMAKE_CURRENT_SOURCE_DIR}/../../SFML/Windows/sfml-window-d-2.dll
                ${CMAKE_CURRENT_SOURCE_DIR}/../../SFML/Windows/sfml-system-d-2.dll
)
 

The CMake generates the executable with no problems but then i get an error message when running it:

"The code execution cannot proceed because sfml-system-d-2.dll was not found. Reinstalling the program may fix this problem."
I get one of these for each DLL.

Thank you in advance, I hope I've detailed my issue clearly enough,
HoC

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Can't find sfml DLLs
« Reply #1 on: April 13, 2020, 11:26:34 pm »
I've tried placing the DLLs in the same directory as the executable, but still no success.
Did you really pick the correct directory?
And did you copy the correct DLLs (i.e. the message is asking for the debug DLLs)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

HighOnComunism

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Can't find sfml DLLs
« Reply #2 on: April 14, 2020, 01:18:12 am »
Yes I'm sure I placed them in the correct directory, and I placed all the DLL's in there so no chance it were the wrong ones.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't find sfml DLLs
« Reply #3 on: April 14, 2020, 08:33:00 am »
Why don't you find_package SFML the right way, which would make your app link to the import libraries and not the DLLs directly (and ensure no other potential issue in your setup)?
Laurent Gomila - SFML developer

HighOnComunism

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Can't find sfml DLLs
« Reply #4 on: April 15, 2020, 12:21:58 am »
You mean like this?

find_package(SFML COMPONENTS system graphics audio REQUIRED)
 

I've had it like that and still no success.
« Last Edit: April 15, 2020, 12:25:35 am by HighOnComunism »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't find sfml DLLs
« Reply #5 on: April 15, 2020, 08:26:36 am »
Quote
I've had it like that and still no success.
But it's definitely better.

The OS can't say it doesn't find the SFML DLLs if they are in the same folder as the executable. I don't know what else to say :-\
Laurent Gomila - SFML developer

HighOnComunism

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Can't find sfml DLLs
« Reply #6 on: April 15, 2020, 01:29:50 pm »
Thank you for your help! Surely I'm doing something stupid and don't realize it, I'll post here when I get this to work.