CasparCG / client

Client software primarily used with the CasparCG Server software for audio and video playout, to control graphics and recording, but it can also be used for other tasks within television broadcast.
https://casparcg.com
GNU General Public License v3.0
284 stars 99 forks source link

Fix building with gcc>=5 and Qt>=5.5 #242

Closed dimitry-ishenko closed 9 months ago

dimitry-ishenko commented 6 years ago
  1. Starting with version 5 gcc defaults to c++11 ABI. This affects std::string, std::list and most of the standard library functions using these classes. The Client includes precompiled libgpio-client.so built with older ABI, which causes linkage failure. To force older ABI _GLIBCXX_USE_CXX11_ABI=0 macro has to be defined in each sub-project.

  2. Starting with Qt 5.5 QString::trimmed() is defined in terms of QString::trimmed_helper() if the compiler supports reference qualifiers. While the Client includes precompiled Qt libraries, it relies on system-installed Qt headers, and unless one installs Qt 5.4 and builds against its headers, this causes runtime symbol lookup error in libcore.so. To work around that one has to define QT_COMPILING_QSTRING_COMPAT_CPP to disable reference qualifiers for QString.

dimitry-ishenko commented 6 years ago

This fixes issue #231 and allows the Client to be built with gcc>=5 and Qt>=5.5.

dimitry-ishenko commented 6 years ago

Any reason why this pretty harmless commit can't be merged? :smiley:

dotarmin commented 6 years ago

Any reason why this pretty harmless commit can't be merged? :smiley:

I have been on vacation for a couple of weeks but I'm back now! Only reason :smiley:

dimitry-ishenko commented 6 years ago

I wish I had so many vacations... :stuck_out_tongue_closed_eyes:

dotarmin commented 6 years ago

@dimitry-ishenko I have tried this and it doesn't build on Ubuntu 16.04.3 LTS. I haven't tried on Windows yet or OS X. I tested this using Qt 5.9.3 and gcc 5.4.0. It complains still on same error as #231

Best regards, Armin

dotarmin commented 6 years ago

It also needs to be rebased after some changes to next branch, fyi.

dimitry-ishenko commented 6 years ago

@dotarmin I've just tried with both my system-wide Qt 5.5.1, as well as Qt 5.9 in /opt/qt59 and it works fine. Could you give me moar detail on how you build?

I will rebase in the meantime.

dimitry-ishenko commented 6 years ago

@dotarmin I've rebased, but there were no conflicts of any kind... Maybe you have other commits in your branch that are not on github?

dotarmin commented 6 years ago

@dimitry-ishenko I've rebased, but there were no conflicts of any kind... Maybe you have other commits in your branch that are not on github?

It's totally my mistake, sorry.

@dimitry-ishenko I've just tried with both my system-wide Qt 5.5.1, as well as Qt 5.9 in /opt/qt59 and it works fine. Could you give me moar detail on how you build?

I will rebase in the meantime.

Strange, I have tried with Qt 5.9.3 that I installed under /opt/qt/5.9.3. I have also installed 5.5.1 from sources also under /opt/qt/5.5.1 with default configuration. I use gcc that's included by build-essential using apt and it's updated that way as well.

I open the Solution in Qt Creator (kit and everything is setup of course), when I build it still complains at the libgpio-client.so. If I instead build the libgpio-client.so from sources and copy over the libgpio-client.so.1.0.0 to the client libs folder, then it works.

/Armin

dimitry-ishenko commented 6 years ago

@dotarmin maybe try building with the set-variables-and-build-linux.sh script in build-scripts. You will need to adjust BUILD_QT_PATH to point to your Qt install. If that works, then it must be something in the Qt Creator settings.

dotarmin commented 6 years ago

Good idea! Didn't even thought about that. I'll will try it when I'm at work. Thanks!

dotarmin commented 6 years ago

@dimitry-ishenko It does actually build as far as I can see by using the set-variables-and-build-linux.sh script but when I try to run it using ./run.sh under the build folder it complains at following:

Cannot mix incompatible Qt library (version 0x50401) with this library (version 0x50903) It could be as simple as Qt 5.9 works well, just as you have tried but 5.9.3 does not.

I will install 5.9 and try same thing with that version. I will let you know how it went.

Update I tried this out with 5.9.0 installed as my other qt versions, under /opt. I still get the same error as above but with another version, 0x50900 instead of 0x50903.

Ideas?

dimitry-ishenko commented 6 years ago

Heh... I have the same thing with 5.9. I will try to look into it on Sunday.

dotarmin commented 6 years ago

Heh... I have the same thing with 5.9. I will try to look into it on Sunday.

Thanks! 😄

dotarmin commented 6 years ago

@dimitry-ishenko Have you looked at this yet?

dimitry-ishenko commented 6 years ago

@dotarmin sorry, my hands are full at the moment with other projects... :disappointed:

dotarmin commented 6 years ago

@dimitry-ishenko No problems, we can leave this PR open until you have time.

/Armin