13

I have the following situation: I need to have program running in an AWS EC2 Server.

The program is made using Qt. Recently, I updated the program AND the Qt Version provided by Amazon to 5.9.2.

I develop the program in one of my computers and when it is done, I copy it to the server.

I use a second computer to connect to the servers (I can switch between connected to the computer next to me or the AWS server).

Now the problem is that when I'm doing one of the transactions, the program on the AWS server crashes with this error:

symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference

If I do the same transaction against the program in my own local computer, it works just fine.

This does not seem to me like a bug caused by my code but rather by the link and/or compile process.

Can anyone tell me what it means o how I can diagnose the problem?

4
  • It means that your computer and your Amazon-hosted web server have different version of the QT framework. When you compile and link code with your C++ library, the resulting binary can only use the same (or compatible) version of the library at runtime. Copying this application to your server and running it will result in these kinds of loading failures if the runtime libraries on your server are not ABI-compatible with the version of the library you compiled and linked with. Oct 27, 2018 at 14:08
  • But this is weird. But my computer and the server use 5.9.2 64 bits. And this wasn't an issue when I used the previous version (5.6). Just in case, what steps should I do in order to verify that the versions of the Qt Framework are the same?
    – aarelovich
    Oct 27, 2018 at 14:21
  • In case, it helps anybody, I've solved the problem by compiling the program in the Amazon Server itself. It lends to the credit to the idea that there was a difference in the Qt Framework, but I'll be darned if I know what it ws
    – aarelovich
    Oct 28, 2018 at 10:36
  • I had the same problem recently. I had Qt6 installed with online installer and QT5 installed with offline installer (it was impossible to install both with online installer). The problem was when I tried to compile my project with QT5, but with QT6 I don't have the problem. So solution which worked for me: upgrade your project to compile with QT6
    – baziorek
    Oct 25 at 9:55

2 Answers 2

15

I had the same issue with Qt 5.11.2 from KDE Neon. But no problem with the official Qt 5.11.2 SDK.

If I add this flag to the project: QMAKE_CXXFLAGS += "-fno-sized-deallocation", eveything works again.

I believe that if you compile your program as c++14 or above, the code will try to do a sized deallocation. Because compiling with -std=c++11 doesn't cause this issue.

Probably, Qt from KDE Neon was compiled as C++11.

4
  • 1
    More in general it can be that the calling program and the Qt libraries have been compiled differently, and a compatibility exception arise. In my case, two versions of the compiler had been used. Recompiling the element that lagged behind solved the issue. Feb 11, 2020 at 12:23
  • I have a similar problem, but the binary in the build dir works, while the system-installed binary doesn't work after I sudo make install. Can dependencies change, depending on the binary being in my build folder, or in my /usr/local/bin?
    – Gauthier
    Sep 16, 2020 at 12:33
  • 1
    Yes, because Linux have the RPATH mechanism, you can make dependencies be relative to the binary path. There is also the case, that if you are running from QtCreator, by default the Qt lib will be loaded from what was specified in the project, not from the system libs. For this case look for LD_LIBRARY_PATH. Sep 17, 2020 at 17:40
  • @Gauthier if you are on a Linux machine then you verify linked library paths by running ldd {your program name} and ldd /usr/local/bin/{your program name}
    – Vencat
    Nov 5, 2021 at 16:27
-2

if PyQt5... cannot be fixed or uninstalled we can force remove it,

sudo rm -rf /usr/lib/python3.10/site-packages/PyQt5*
```
we can reinstall all necessary packages
```bash
pip install ....
```

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.