# Problem porting SFML.jl to Julia 1.1

**URL:** <https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029>\
**Category:** General Usage\
**Tags:** package\
**Created:** [January 24, 2019, 11:40am UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029 "2019-01-24T11:40:22Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 24, 2019, 11:40am UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/1 "2019-01-24T11:40:22Z")

</div>

I was very interested in porting SFML.jl (from nice work of zyedidia,  
[https://github.com/zyedidia/SFML.jl](https://github.com/zyedidia/SFML.jl))  
to current Julia, because it is not working for Julia 0.7 (and I like to use SFML in my programming introductory courses). I have ported all code in

> **[GitHub - dmolina/SFML.jl: A binding of the game and multimedia library SFML...](https://github.com/dmolina/SFML.jl#fixed_julia1)**
>
> A binding of the game and multimedia library SFML for Julia - GitHub - dmolina/SFML.jl: A binding of the game and multimedia library SFML for Julia

(I will do a PR when it is finished).

However, while it install the package without problem, at least in my computer (after many changes), I have problem when library was loaded. I know there was a change in usage of Libdl.dlopen ([https://github.com/JuliaLang/julia/issues/26557](https://github.com/JuliaLang/julia/issues/26557)) and I think it is related but I have not idea how I could fix it. When I run the dlopen manually “julia SFML.jl”  
(or do Libdl.dlopen(“libcsfml-graphics”, Libdl.RTLD\_GLOBAL) in the REPL)  
it is loaded nicely, however, when I try to run an example, it said:

ErrorException(“could not load library "libcsfml-system"\nlibsfml-system.so.2: cannot open shared object file: No such file or directory”)  
ERROR: LoadError: error compiling Type: error compiling Type: could not load library “libcsfml-graphics”

My version of SFML is working with my previously installed SFML.  
I can compiling and running programs in C++ and even Rust without problem, so the libraries are installed.

Any idea?

PS: If anyone is interested in porting it, you can say and work together :-). I think SFML.jl working could be a good example of using Julia as a general programming language.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [January 24, 2019, 12:29pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/2 "2019-01-24T12:29:54Z")

</div>

@scelles has already made a PR targeting Julia v0.7:

> <https://github.com/zyedidia/SFML.jl/pull/51>
>
> Related to #49

and here are some thoughts on upgrading the build system to BB2 which can provide an out of box installation experience.

> [@Nuklear.jl - A Julia wrapper for Nuklear?](https://discourse.julialang.org/t/nuklear-jl-a-julia-wrapper-for-nuklear/17990/12):
>
> search function is not continued in Julia v1.0, you could use occursin I guess. It looks like SFML is not actively maintained(last commit is one year ago). It would be great if we could upgrade the build system to BB2 with which installation related issues would be solved spontaneously. To this end, we need to build those missing BB projects from this list: [Frequently Asked Questions (SFML / Learn)](https://www.sfml-dev.org/faq.php#grl-dependencies) I don’t know whether those wrappers were written by hand or generated using old Clang.jl, but ma…

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 24, 2019, 12:36pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/3 "2019-01-24T12:36:05Z")

</div>

Yes, I know. My changes are strongly based in scelles, and I already do more changes to the continuous integration and better Linux support (the detection of the libraries, for instance). I have also made several more changes. Thanks for send me that talk, I did not see it. I will write there.

---

<div class="post-metadata">

**Author:** ![scelles](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scelles/32/220408_2.png) [@scelles](https://discourse.julialang.org/u/scelles)\
**Post date:** [January 24, 2019, 1:25pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/4 "2019-01-24T13:25:31Z")

</div>

I also think there is a lot of interest in having SFML usable with recents Julia versions. Showing that small games can be written in Julia using such a wrapper could lead people outside of technical computing to Julia.  
Unfortunately my bandwidth is currently a bit limited. I can only spend some time helping to test it under differents OS (Linux, OS X and Windows)

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 24, 2019, 2:22pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/5 "2019-01-24T14:22:16Z")

</div>

Yes, I agree. It could be useful for showing as a general programming language. Please, could you check if in Windows or Mac there is also problem linking with the library? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [January 28, 2019, 4:36pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/6 "2019-01-28T16:36:41Z")

</div>

OK, making progress. Now both macOS and Windows versions are working very well with BB2, and I also regenerated CSFML bindings using Clang.jl:

> **[GitHub - JuliaMultimedia/SFMLBuilder: Binary builder for SFML](https://github.com/JuliaMultimedia/SFMLBuilder)**
>
> Binary builder for SFML. Contribute to JuliaMultimedia/SFMLBuilder development by creating an account on GitHub.

> **[GitHub - JuliaMultimedia/CSFML.jl: Julia bindings for CSFML](https://github.com/JuliaMultimedia/CSFML.jl)**
>
> Julia bindings for CSFML. Contribute to JuliaMultimedia/CSFML.jl development by creating an account on GitHub.

As for Linux, I still can’t figure out how to build the following dependencies:

- pthread
- opengl
- xlib
- xrandr
- udev
- freetype
- openal
- flac
- vorbis

It looks like building xlib is not a trivial task, so my plan is to try a hybrid solution – directly download SFML’s official binaries(will try this tomorrow).

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 28, 2019, 4:45pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/7 "2019-01-28T16:45:31Z")

</div>

Great job! Curiously I was now watching a video about BinaryBuilder :-).  
I always run in Linux, so I can check in Linux, I could help you if you need it.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [January 29, 2019, 1:47pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/8 "2019-01-29T13:47:59Z")

</div>

@dmolina @scelles you could test it now:

> **[GitHub - JuliaMultimedia/CSFML.jl: Julia bindings for CSFML](https://github.com/JuliaMultimedia/CSFML.jl)**
>
> Julia bindings for CSFML. Contribute to JuliaMultimedia/CSFML.jl development by creating an account on GitHub.

on Linux, we still need to manually install those dependencies, especially `libopenal-dev` which is unlikely preinstalled in any dists.

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 29, 2019, 2:57pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/9 "2019-01-29T14:57:22Z")

</div>

It is working! I had only to previous install libopenal-dev (in my Ubuntu 18.04, x64 arquitecture) and then I could install CSFML without any problem!. Later, I could run the example without any problem in Julia 1.1.

Thanks a lot!

With CSFML working, maybe we could do a new SFML package using this CSFML package/module (I say mainly to offer a OO wrapper).

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [January 30, 2019, 1:16am UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/10 "2019-01-30T01:16:57Z")

</div>

> [@dmolina](#):
>
> With CSFML working, maybe we could do a new SFML package using this CSFML package/module (I say mainly to offer a OO wrapper).

It would be nice if we could resurrect SFML.jl. Shall we ping the author and revisit this?

> <https://github.com/zyedidia/SFML.jl/issues/45>
>
> I find SFML super intuitive but I know it from C++.  
> It would be good to \*\*sug…gest\*\* it to other people not familiar with C++ multimedia libraries.  
> I got to know \*Plotly\*, \*PlotlyJS\* and \*GR\* just because someone had put it into an intuitively named package called \*\*Plots\*\*
> Great binding by the way!
> Include it here: \[JuliaGraphics\](https://github.com/Juliagraphics)

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 30, 2019, 12:33pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/11 "2019-01-30T12:33:59Z")

</div>

Yes, I agree that we should resurrect SFML.jl, actually I have just write an issue  
[https://github.com/zyedidia/SFML.jl/issues/53](https://github.com/zyedidia/SFML.jl/issues/53)  
in the Github repository. If in a few days there is not response, we could send a email. In the worst scenario, we could send a new package, like SFMLv2 or similar, but it is clearly more convenience to resurrect SFML.jl.

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 30, 2019, 4:45pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/12 "2019-01-30T16:45:09Z")

</div>

The author is open to the idea:  
[https://github.com/zyedidia/SFML.jl/issues/53#issuecomment-459007906](https://github.com/zyedidia/SFML.jl/issues/53#issuecomment-459007906)

Do you have a suggestion about how it could be the best way to doing that?

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [January 30, 2019, 8:07pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/13 "2019-01-30T20:07:35Z")

</div>

Recently, the author have add to both of us as collaborators, so meanwhile we could write in the SFML.jl Github repository 👍.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [January 31, 2019, 12:22pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/14 "2019-01-31T12:22:37Z")

</div>

OK, I just registered LibCSFML.

---

<div class="post-metadata">

**Author:** ![nfehrenbach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nfehrenbach/32/8926_2.png) [@nfehrenbach](https://discourse.julialang.org/u/nfehrenbach)\
**Post date:** [June 14, 2019, 6:33am UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/15 "2019-06-14T06:33:50Z")

</div>

Hey all, I am also interested in getting SFML to work on Julia 1.1. It wasn’t clear to me whether you were resurrecting it, or starting fresh with LibCSFML (sorry if it’s a noob question, am just getting my feet wet coming over from C# and python)

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [June 15, 2019, 9:26am UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/16 "2019-06-15T09:26:16Z")

</div>

Hi. My idea was resurrecting it, over the LibCSFML, but the many courses this semester have made me not having time for doing that. I hope to have more time in a few days to start working on it, and any help is welcome!

---

<div class="post-metadata">

**Author:** ![nfehrenbach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nfehrenbach/32/8926_2.png) [@nfehrenbach](https://discourse.julialang.org/u/nfehrenbach)\
**Post date:** [June 15, 2019, 6:11pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029/17 "2019-06-15T18:11:42Z")

</div>

I understand, I’ve been working on a project in python for 3 months and barely have a prototype working because of being busy with work and life. In case you didn’t know, I found this binding that I got working on Lubuntu:

[https://github.com/JuliaMultimedia/CSFML.jl](https://github.com/JuliaMultimedia/CSFML.jl)

I never got the chance to work with the SFML.jl so I dont know if it was any better, but it worked for me without too much fuss.
