Beginner: build for WebGL on Linux fails (error while loading shared libraries: libtinfo.so.5)

Hi, I successfully write my first game with Unity. I wroks in Unity itself and I successfully built it for Linux so that it runs out of Unity, too. No I want to build it for WebGL but after “Switch …” and “Build”, Unity shows Errors. The first one is:

stdout:
Building build.bc with EmscriptenToolChain
Output directory: /home/Daten/Projekte/Unity/Games/Pong2D/Temp/StagingArea/Data/Native
Cache directory: /home/Daten/Projekte/Unity/Games/Pong2D/Library/il2cpp_cache
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: /home/Daten/Programme/Unity/Editors/2019.4.11f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten_FastComp_Linux/clang++: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting

I use Ubuntu 20.04 LTS Linux with UnityHub.AppImage. The game build flawlessly for the “Linux” target. Are there some requirements missing or is WebGL building under Linux broken?

hey, i solved it by creating a symlink with a later version of libtinfo.so

sudo ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5

(this makes the second argument redirect to the first argument)

You are a genius :wink: Thanks.

I wonder how people can reach that kind of magic solutions hehe

2 Likes

Well done for making Pong in Linux mate :slight_smile:

Thanks for pointing out the problem guys.
I case You do not have libtinfo5 in your system (Ubuntu 20.10) do sudo apt install libtinfo5 (or some newer version? https://ubuntu.pkgs.org/20.10/ubuntu-universe-amd64/libtinfo5_6.2-1_amd64.deb.html).

I got new error Failed running python2 "/home/foton/Unity/Hub/Editor/2019.4.21f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Brotli/python/bro.py"
but at least one step forward.

1 Like

Finally, I made it!
I am UBUNTU 20.10 user and i must :

  • install libtinfo5 library sudo apt install libtinfo5

  • python select MacOS Brothli egg, instead Linux one so I do rename and symlink

  • “cd /home/:username/Unity/Hub/Editor/2019.4.21f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Brotli/dist/”

  • “mv Brotli-0.4.0-py2.7-macosx-10.10-x86_64.egg real_Brotli-0.4.0-py2.7-macosx-10.10-x86_64.egg”

  • “ln -s Brotli-0.4.0-py2.7-linux-x86_64.egg Brotli-0.4.0-py2.7-macosx-10.10-x86_64.egg”

And then I was able to publish my game to WebGL and web.

1 Like

ALTERNATIVE:

You can just change the compression format from Brotli to Disabled under Project Settings > Player > Publishing Settings.

7214242--867127--upload_2021-6-7_12-46-39.png

If you want to upload the game to itch.io, you have to do this anyway :wink:

1 Like

sudo apt install libtinfo5

works for me on Linux Mint. Hooray! pops up a server at http://localhost:42305/

Very helpful, I’ve not actually made anything yet despite having a ton of tutorial projects on the go though.