Important: Please read the Qt Code of Conduct -

How to resolve hidden symbol linking error

  • I am able to make static libraries of

    1. libQtCore.a and libQtGui.a
    2. (recompiled without which is recompiled without dependencies on runtime QT libraries) . but I am getting this following error

    hidden symbol `_ZNK7QLayout11minimumSizeEv' in libQtGui.a(qlayout.o) is referenced by DSO

    This is happening because by default when static libraries are built the fvisibility=hidden -fvisibility-inlines-hidden for compiling all the cpp files of Qt code . When I remove this flag , I am able to link the libraries

    What is correct solution to remove the linking error hidden symbol `_ZNK7QLayout11minimumSizeEv' is referenced by DSO is referenced by DSO

    Also I have a query I make shared library with the same code base of QtCore and QtGui and also CXXFLAGS -fvisibility=hidden and when I link the shared libraries and in my final executable then it works fine and I do not get any linker error

Log in to reply