-
Notifications
You must be signed in to change notification settings - Fork 48
Document static SFML library linking and dependencies #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
1220bfd
6c6f09a
308b15f
7c6ac50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
||
| !!! note | ||
|
|
||
| This is a very beginner-hostile workflow and not the recommended way to start learning SFML. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment seems unnecessary - what's particularly hostile about it for beginners?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.