What is required for link Widgets?
-
Hi. What dependencies do you need to link widgets? (static build app, qt is building in static, static runtime)
-
Simply try out to see what linker errors you get. I would guess there are no errors when you use qmake or cmake.
-
@Christian-Ehrlicher build.log. Is linked:
"Qt5Core", "Qt5Gui", "Qt5Widgets", "Qt5EventDispatcherSupport", "Qt5FontDatabaseSupport", "Qt5PlatformCompositorSupport", "Qt5ThemeSupport", "qtfreetype", "qtlibpng", "qtpcre2", "qtharfbuzz", "dl", "pthread"
what the linker still lacks libraries?
-
-
@Christian-Ehrlicher what libraries do I need to add in order for the app to link?
-
@continue98
I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output..... -
@JonB said in What is required for link Widgets?:
I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output.....
What? build.log - stdout / stderr from make. What should I show?
-
@continue98 said in What is required for link Widgets?:
What?
All you wrote earlier was:
@Christian-Ehrlicher build.log. Is linked:
I for one did not understand that the word build.log in that line was actually a hyperlink to the output from your link, showing what remains unreferenced. Maybe @Christian-Ehrlicher did notice this, maybe he did not. It took me a while to spot.
All I am saying is, I would have indicated something like:
Please click on this link to see what remains unreferenced when I try to link: build.log.
-
@JonB: No I did not.
@continue98: How did you build Qt. What build system do you use (I already asked you). From looking at your log I doubt you're correctly linking against the other static Qt libs.
-
@Christian-Ehrlicher I am use build-system premake5. All libraries that I link to the project:
"Qt5Core", "Qt5Gui", "Qt5Widgets", "Qt5EventDispatcherSupport", "Qt5FontDatabaseSupport", "Qt5PlatformCompositorSupport", "Qt5ThemeSupport", "qtfreetype", "qtlibpng", "qtpcre2", "qtharfbuzz", "dl", "pthread"
Qt configure (static build):
./init-repository &> init_repo.log && ./configure -debug -static -static-runtime -opensource -confirm-license -platform linux-g++-32 -qt-zlib -qt-libpng -qt-libjpeg -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -nomake examples -nomake tests -prefix "/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug" &> configure.log && sudo make -j 6 &> build.log
-
Sorry I don't know how to use premake and how to make sure there that the correct qmake executable and static Qt libs are used.
-
@Christian-Ehrlicher The problem is not in the technical part, how to use it in premake. The problem is that I don't know which libraries are still needed (undefined reference).
qt_libs = { "Qt5Core", "Qt5Gui", "Qt5Widgets", "Qt5EventDispatcherSupport", "Qt5FontDatabaseSupport", "Qt5WindowsUIAutomationSupport", // analog for Linux? "Qt5PlatformCompositorSupport", "Qt5ThemeSupport", "qtfreetype", "qtmain", // analog for Linux? "qtlibpng", "qtpcre2", "qwindows", // analog for Linux? "qtharfbuzz" } links { qt_libs }
Everything links perfectly and works (Windows 10), but Linux needs some other libraries and there is no difference at all what you use for the build system (cmake, premake, etc..). It forces GCC to link it with the -l flag anyway.
LIBS += -lQt5Core -lQt5Gui -lQt5Widgets -lQt5EventDispatcherSupport -lQt5FontDatabaseSupport -lQt5PlatformCompositorSupport -lQt5ThemeSupport -lqtfreetype -lqtlibpng -lqtpcre2 -lqtharfbuzz -ldl -lpthread ALL_LDFLAGS += $(LDFLAGS) -L/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug/lib -L/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug/plugins/platforms -L/usr/lib32 -m32 -static -static-libstdc++
-
@continue98 said in What is required for link Widgets?:
there is no difference at all what you use for the build system (cmake, premake, etc..)
It is - I know that I don't need to add extra libs when Qt is linked statically with cmake or qmake. So in there scripts there must be something which is not added by premake
/edit: and as you can see here it looks like even you added Qt5Gui, a symbol from there is not found so it must be something with the build system picking up the wrong libs or similar problems:
/home/continue/qt5/qtbase/src/widgets/../../include/QtGui/5.15.0/QtGui/private/../../../../../src/gui/kernel/qguiapplication_p.h:284: undefined reference to `QTouchEvent::TouchPoint::TouchPoint(QTouchEvent::TouchPoint const&)'
-
Ok. I am enable linksgroup. Linking works now. But some error:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
If add:
Q_IMPORT_PLUGIN (QXcbIntegrationPlugin)
. Some error:/home/continue/qt5/qtbase/src/plugins/platforms/xcb/qxcbmain.cpp:56: undefined reference to `QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**)'
-
@continue98 said in What is required for link Widgets?:
QXcbIntegration
this is a separate plugin / library which you don't link against as it seems.