lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
72 stars 35 forks source link

Conflicts with QtGui symbols on static link #208

Closed ilya-fedin closed 3 years ago

ilya-fedin commented 4 years ago

When linking QtGui and libqtxdg statically to an app, QIconCacheGtkReader and PixmapEntry::pixmap with the ones from qiconloader.cpp

Expected Behavior

libqtxdg should work with static link

Current Behavior

https://github.com/ilya-fedin/tdesktop/runs/645416587?check_suite_focus=true

Possible Solution

Maybe, hide them under namespace? :thinking:

Steps to Reproduce (for bugs)
  1. Link an app statcally with QtGui and XDGIconLoader at the same time
Context

I tried to link tdesktop static binary with lxqt-qtplugin to allow it to get lxqt system settings (fonts, icon theme, etc), but it requires xdgiconloader from libqtxdg, that has this issue :(

System Information

I hope, this is unrelated (but you have a link to the GH action job) :)

luis-pereira commented 4 years ago

Maybe, hide them under namespace? thinking

That's a possible solution. But, I have not looked into it, yet.

ilya-fedin commented 4 years ago

If they're needed just because these symbols aren't exported, maybe just add a QTXDG_STATIC_BUILD define and hide these declarations with #ifndef? :thinking: Something similar is done in tdesktop: https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/qt_functions.cpp

ilya-fedin commented 4 years ago

It works for me with these changes: https://github.com/ilya-fedin/libqtxdg/commits/fix-static-build If it is OK for you, I can open a PR.

ilya-fedin commented 4 years ago

I opened https://github.com/lxqt/libqtxdg/pull/212