Skip to content

Missing GLEW runtime DLL on Windows build (fixed with CMake snippet) #33

@luisffl

Description

@luisffl

Description

When building on Windows, the program compiles successfully but fails to run due to missing glew32d.dll / glew32.dll.

Cause

CMake does not copy the GLEW/GLFW runtime DLLs to the output directory.

Fix

Adding this snippet at the end of CMakeLists.txt resolves the issue:

if (WIN32)
    add_custom_command(TARGET BlackHole3D POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
                $<TARGET_RUNTIME_DLLS:BlackHole3D> $<TARGET_FILE_DIR:BlackHole3D>
        COMMAND_EXPAND_LISTS
    )
endif()

Once the snippet is added, follow the README instrucctions as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions