#I need help setting up SFML

78 messages · Page 1 of 1 (latest)

weak latch
#

I have tried everything setting up a library but to no avail.

olive schoonerBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

wheat summit
#

what platform?

weak latch
#

Visual Studio

wheat summit
#

have you downloaded and built sfml yet

weak latch
#

I have downloaded SFML

#

but i dont know how to set it up to my project

wheat summit
#

right click on the project

#

and go to properties

weak latch
#

Done

wheat summit
#

you need to add a couple things for it to work

weak latch
#

alr

wheat summit
weak latch
#

done

wheat summit
#

you need to add the directory the includes are in

weak latch
#

wait hol on

dry zephyr
#
include(FetchContent)

FetchContent_Declare(
  sfml
  GIT_REPOSITORY https://github.com/SFML/SFML
  GIT_TAG 2.6.1
)

FetchContent_MakeAvailable(sfml)

add_executable(foo)
target_link_libraries(foo PRIVATE sfml-graphics) 
target_sources(foo PRIVATE main.cpp)
wheat summit
#

dont think hes using cmake

acoustic lantern
#

fork this proj

weak latch
#

oh damn

wheat summit
#

but i guess that would work

dry zephyr
wheat summit
#

well you would have cmake create your solution file then open that

#

so easier 😆

weak latch
#

alr

dry zephyr
#

You can open CMake projects directly in VS too, no need to deal with solutions at all.

acoustic lantern
#

cause you have to constantly update cmakelists with new source files

wheat summit
#

oh really? i dont use vs much

#

nice i guess

acoustic lantern
wheat summit
#

magic

dry zephyr
weak latch
dry zephyr
weak latch
dry zephyr
#

What's the friction, why are you hesitating?

weak latch
#

Well..

#

yeah man i didnt learn allat

dry zephyr
#

You're gonna have to spend time reading and learning things...

#

Not just CMake, in general.

weak latch
#

i know bro😭

dry zephyr
#

Alr lol, I'll give you some milestones, maybe it will give you some goals to reach.

weak latch
#

alr

dry zephyr
#

First: a hello world project using CMake.

#

Next: a project that uses multiple source files and headers.

weak latch
#

i can just change the code on .cpp file

dry zephyr
#

Next: project that creates a library and an executable that links to it.

weak latch
#

im such a w for this

dry zephyr
#

Cool, keep in mind that the C++ itself is not that important here, you're learning how to setup builds and projects properly. So the CMake script, file structure, etc are what matter more.

weak latch
#

Yeah

dry zephyr
weak latch
#

ty bro

dry zephyr
weak latch
#

ight

dry zephyr
#

Use Open Folder or Open CMake

weak latch
#

kk

#

im tired already

#

im gonna go sleep

#

ty @dry zephyr

acoustic lantern
#

whos epsilon

#

they werent even part of the thread 😭

weak latch
#

nah his typing

acoustic lantern
#

it wasnt the right epsilon

weak latch
#

oh damn wrong ping

vapid orbit
#

Its not that hard just download sfml package from their website (matches platform and visual studio platform version) extract it, goto Project Properties -> C/C++ -> Additional Include Directories, add the path to extracted sfml's include folder,
Then move to Linker -> Additional library directories and add to it the path of lib folder in extracted sfml, then goto Linker -> Input -> Dependencies put in the names of libraries to link
Like
smfl-graphics.lib sfml-window.lib sfml-system.lib

All while your platform and configuration is set properly.

weak latch
#

alr i took a picture of that

#

im gonna sleep now, tmrw ill finish it

#

ty yall

#

!solved