Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'Getting Started' started by LinuxDevJ, Sep 27, 2020.

  1. LinuxDevJ

    LinuxDevJ

    Joined:
    Sep 26, 2020
    Posts:
    23
    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?
     
  2. pierre_d_

    pierre_d_

    Joined:
    Feb 20, 2019
    Posts:
    1
    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)
     
  3. leandiez

    leandiez

    Joined:
    Jan 17, 2019
    Posts:
    4
    You are a genius ;) Thanks.

    I wonder how people can reach that kind of magic solutions hehe
     
    RichAllen2023 and Joe-Censored like this.
  4. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    Well done for making Pong in Linux mate :)
     
  5. Foton_mndp

    Foton_mndp

    Joined:
    Mar 1, 2021
    Posts:
    2
    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.
     
    tomachinz likes this.
  6. Foton_mndp

    Foton_mndp

    Joined:
    Mar 1, 2021
    Posts:
    2
    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.
     
    ade_epnp likes this.
  7. jgol

    jgol

    Joined:
    Aug 16, 2020
    Posts:
    6
    ALTERNATIVE:

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

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

    If you want to upload the game to itch.io, you have to do this anyway ;)
     
    amarquessbr likes this.
  8. tomachinz

    tomachinz

    Joined:
    Mar 2, 2019
    Posts:
    15
  9. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    Very helpful, I've not actually made anything yet despite having a ton of tutorial projects on the go though.