this post was submitted on 07 Aug 2026
5 points (100.0% liked)

Linux Mint

363 readers
10 users here now

A community for news and discussion about linux mint

founded 2 years ago
MODERATORS
 

Ubuntu package libdev-sfml is only up to 2.6. How can I get sfml 3.0 for C++ on my machines? Am I just gonna have to build it from source?

top 2 comments
sorted by: hot top controversial new old
[โ€“] anon5621@lemmy.ml 3 points 4 days ago* (last edited 4 days ago)

Just use cmake with cloning 3 version from git and compile as part of ur project it pretty easy actually

cmake_minimum_required(VERSION 3.28)
project(MyGame LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(FetchContent)

FetchContent_Declare(
    SFML
    GIT_REPOSITORY https://github.com/SFML/SFML.git
    GIT_TAG        3.0.0
    GIT_SHALLOW    ON
)

set(SFML_BUILD_EXAMPLES OFF)
set(SFML_BUILD_DOC OFF)
set(BUILD_SHARED_LIBS ON)  

FetchContent_MakeAvailable(SFML)

add_executable(MyGame src/main.cpp)

#example libs which u need 
target_link_libraries(MyGame PRIVATE
    SFML::Graphics
    SFML::Window
    SFML::System
    SFML::Audio      
)
[โ€“] jdnewmil@lemmy.ca -1 points 4 days ago

Looks like it. Isn't open source nice?