Nominate our 2022 Qt Champions!

Best way to deploy to Google Compute Engine?

  • Hello,

    As part of a hobby project I'm trying to set up a chat server on Google Compute Engine. I have written a very basic console server app and widget-based client app. They communicate by websockets. I am now trying to deploy the server app to GCE and have tried two approaches but after many many hours I cannot get either to work.

    1. The first approach was to clone my git repository to the GCE instance (running Ubuntu 16.04) with the intention of installing Qt and compiling the server app on the instance. However, I could not get either the offline or the online installers to work from the command line on a headless system, even using the -script option. Each time I would get 'error while loading shared libraries' errors, first for xcb, then fontconfig.

    So, I copied the compiled server app to the instance and tried to install the dependencies from the repository hoping it would run, but ldd reports this, probably because the repository seems to have Qt 5.5.1, and I'm using 5.7.

    mattj@chat-server:~/chat-server/chat-server$ ldd chat-server
    ./chat-server: /usr/lib/x86_64-linux-gnu/ version `Qt_5' not found (required by ./chat-server)
    ./chat-server: /usr/lib/x86_64-linux-gnu/ version `Qt_5' not found (required by ./chat-server)
    ./chat-server: /usr/lib/x86_64-linux-gnu/ version `Qt_5.7' not found (required by ./chat-server)
    ./chat-server: /usr/lib/x86_64-linux-gnu/ version `Qt_5' not found (required by ./chat-server)
   =>  (0x00007ffe53db3000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1b6e3000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1b589000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1b0b2000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1ad30000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b1ab1a000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b1a750000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b1a533000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b1a319000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1a0f7000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b19c95000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b19901000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b1969a000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b19496000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b19185000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b18f7c000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b18c73000)
            /lib64/ (0x00005581f600e000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f8b171bb000)
   => /lib/x86_64-linux-gnu/ (0x00007f8b16f4b000)
    1. Next I tried to build a static version of Qt from source. I was able to but it only appears to build qtbase, not any other module. I can't find anywhere in the documentation or configure -h that suggests how to include other modules. When I tried to compile the server app with the static version, I get this error:
    Unknown module(s) in QT: websockets

    So now I am stuck. What is the best method to get my server app on the GCE instance?


  • Lifetime Qt Champion


    1. You need to deploy your app with all needed libraries and plug-ins. See

Log in to reply