Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Best way to deploy to Google Compute Engine?
mattj last edited by mattj
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.
- 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/libQt5Network.so.5: version `Qt_5' not found (required by ./chat-server) ./chat-server: /usr/lib/x86_64-linux-gnu/libQt5WebSockets.so.5: version `Qt_5' not found (required by ./chat-server) ./chat-server: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./chat-server) ./chat-server: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./chat-server) linux-vdso.so.1 => (0x00007ffe53db3000) libQt5WebSockets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5WebSockets.so.5 (0x00007f8b1b6e3000) libQt5Network.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007f8b1b589000) libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f8b1b0b2000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8b1ad30000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8b1ab1a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8b1a750000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8b1a533000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8b1a319000) libproxy.so.1 => /usr/lib/x86_64-linux-gnu/libproxy.so.1 (0x00007f8b1a0f7000) libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f8b19c95000) libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f8b19901000) libpcre16.so.3 => /usr/lib/x86_64-linux-gnu/libpcre16.so.3 (0x00007f8b1969a000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8b19496000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f8b19185000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8b18f7c000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8b18c73000) /lib64/ld-linux-x86-64.so.2 (0x00005581f600e000) libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f8b171bb000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8b16f4b000)
- 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?
- You need to deploy your app with all needed libraries and plug-ins. See http://doc.qt.io/qt-5/linux-deployment.html