Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pages/tutorials/3.0/getting-started/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ If you installed SFML to a non-standard path, you'll need to tell the linker whe
```
g++ main.o -o sfml-app -L<sfml-install-path>/lib -lsfml-graphics -lsfml-window -lsfml-system
```
If you want to have SFML directly integrated into your executable, you must link to the static version. Static SFML libraries have the "-s" suffix, for example: "sfml-xxxx-s".
You will also need to link the dependancies of each sfml module.
Comment thread
ShadowTheLegendary marked this conversation as resolved.
Outdated

!!! note

This is a very beginner-hostile workflow and not the recommended way to start learning SFML.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems unnecessary - what's particularly hostile about it for beginners?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk, the people on discord called it beginer hostile



| Module | Dependencies |
|-----------------|--------------|
| sfml-graphics-s |<ol><li>sfml-window-s<li>freetype<li>sfml-system-s</li></ol>|
| sfml-window-s |<ol><li>sfml-system-s<li>Xi<li>X11<li>Xrandr<li>Xcursor<li>udev</li></ol>|
| sfml-system-s ||
| sfml-network-s |<ol><li>sfml-system-s</li></ol>|
| sfml-audio-s |<ol><li>sfml-system-s<li>FLAC<li>vorbisenc<li>vorbisfile<li>vorbis<li>ogg</li></ol>|

Example with sfml-window and sfml-system. You will also need to define SFML_STATIC as a macro either in the script or in the compiler flags.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SFML_STATIC is not necessary on linux

```
g++ main.o -o sfml-app -lsfml-window-s -lsfml-system-s -lXi -lX11 -lXrandr -lXcursor -ludev -DSFML_STATIC
```

We are now ready to execute the compiled program:

Expand Down