[Development] Symbol clashes with static Qt libraries

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Tue Jul 31 16:01:37 CEST 2018

> On 31 Jul 2018, at 15:58, Konstantin Shegunov <kshegunov at gmail.com> wrote:
> On Tue, Jul 31, 2018 at 2:43 PM, Kai Koehne <Kai.Koehne at qt.io> wrote:
> Hi,
> I'm wondering how we can avoid symbol clashes in static Qt libs + user code.
> a) Prefix all symbols with 'q', like we do for exported symbols.
> This requires some bigger patches. See e.g. https://codereview.qt-project.org/#/c/235631/ for renaming all logging categories to 'qlc*' in qtbase.
> Isn't introducing a private namespace for that purpose an option?
> I think it'd fare better than renaming the symbols, and in the end that's the whole reason for having them in the language, right?
> Granted there should be an using clause at the top of the sources that use those private methods and explicit scoping for public headers (if any), but that should solve the problem I believe. Also patching it up should be relatively straightforward.

That seems preferable to the variable renaming, yes.

Tor Arne 

> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

More information about the Development mailing list