How can I integrate an existing Qt project in another Qt project
-
Thank you first. I am still very inexperienced in terms of programming with Qt. :/
I have now downloaded the project from you "SubdirsExample". Unfortunately, I can not do it correctly. I get the error messages:c:/users/robin/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lLib ..\..\SubdirsExample\App/mainwindow.cpp:13: error: undefined reference to 'Lib::greet()' collect2.exe: error: ld returned 1 exit status make[1]: *** [libApp.so] Error 1 make: *** [sub-App-make_first] Error 2 make[1]: Leaving directory `C:/Users/Robin/Documents/build-SubdirsExample-Android_f_r_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Debug/App' 09:44:22: Der Prozess "C:\Users\Robin\android-ndk-r17b\prebuilt\windows-x86_64\bin\make.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts SubdirsExample (Kit: Android für armeabi-v7a (GCC 4.9, Qt 5.11.1 for Android armv7)) Bei der Ausführung von Schritt "Make"
I have testet with different devices (with a Android device and with Desktop Qt 5.11.1 32 Bit). Additional I have tried the programm under Windwos and Linux, but the same error message.
I think that the error is in the blue marked line. The compiler tried to read the Lib.lib File, but in order "Lib" I have only:
lib.cpp
lib.h
Lib.pro
lib_global.hI don´t have a .lib-File.
This is your program. Do you have the same error or do you know, where is the problem in detail?
It seems you already modified my project. It worked perfectly fine for me on Ubuntu, and it should work on Windows too.
Please provide a complete compile log (as text!), preferable from a native compiler. I especially need to see the linker command call.
-
All the changes I made are commented on.
Here is my complete compile log:
14:55:20: Führe Schritte für Projekt SubdirsExample aus... 14:55:20: Unveränderte Konfiguration, qmake-Schritt wird übersprungen. 14:55:20: Starte "C:\Users\Robin\android-ndk-r17b\prebuilt\windows-x86_64\bin\make.exe" cd App\ && ( if not exist Makefile C:\Qt\Qt5.11.1\5.11.1\android_armv7\bin\qmake.exe -o Makefile C:\Users\Robin\Documents\SubdirsExample\App\App.pro -spec android-g++ "CONFIG+=debug" "CONFIG+=qml_debug" ) && C:/Users/Robin/android-ndk-r17b/prebuilt/windows-x86_64/bin/make -f Makefile make[1]: Entering directory `C:/Users/Robin/Documents/build-SubdirsExample-Android_f_r_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Debug/App' C:\Qt\Qt5.11.1\5.11.1\android_armv7\bin\uic.exe ..\..\SubdirsExample\App\mainwindow.ui -o ui_mainwindow.h C:\Users\Robin\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=16 --sysroot=C:\Users\Robin\android-ndk-r17b/sysroot -isystem C:\Users\Robin\android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtCore -I. -I. -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\mkspecs\android-g++ -o main.obj ..\..\SubdirsExample\App\main.cpp C:\Users\Robin\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=16 --sysroot=C:\Users\Robin\android-ndk-r17b/sysroot -isystem C:\Users\Robin\android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtCore -I. -I. -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\mkspecs\android-g++ -o mainwindow.obj ..\..\SubdirsExample\App\mainwindow.cpp C:\Users\Robin\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -D__ANDROID_API__=16 --sysroot=C:\Users\Robin\android-ndk-r17b/sysroot -isystem C:\Users\Robin\android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -dM -E -o moc_predefs.h C:\Qt\Qt5.11.1\5.11.1\android_armv7\mkspecs\features\data\dummy.cpp C:\Qt\Qt5.11.1\5.11.1\android_armv7\bin\moc.exe -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -IC:/Qt/Qt5.11.1/5.11.1/android_armv7/mkspecs/android-g++ -IC:/Users/Robin/Documents/SubdirsExample/App -IC:/Users/Robin/Documents/SubdirsExample/Lib -IC:/Qt/Qt5.11.1/5.11.1/android_armv7/include -IC:/Qt/Qt5.11.1/5.11.1/android_armv7/include/QtWidgets -IC:/Qt/Qt5.11.1/5.11.1/android_armv7/include/QtGui -IC:/Qt/Qt5.11.1/5.11.1/android_armv7/include/QtCore -I. -IC:/Users/Robin/android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -IC:/Users/Robin/android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/include -IC:/Users/Robin/android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -Ic:/users/robin/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include -Ic:/users/robin/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include-fixed -IC:/Users/Robin/android-ndk-r17b/sysroot/usr/include ..\..\SubdirsExample\App\mainwindow.h -o moc_mainwindow.cpp C:\Users\Robin\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -D__ANDROID_API__=16 --sysroot=C:\Users\Robin\android-ndk-r17b/sysroot -isystem C:\Users\Robin\android-ndk-r17b/sysroot/usr/include/arm-linux-androideabi -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\include\QtCore -I. -I. -IC:\Qt\Qt5.11.1\5.11.1\android_armv7\mkspecs\android-g++ -o moc_mainwindow.obj moc_mainwindow.cpp C:\Users\Robin\android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ --sysroot=C:\Users\Robin\android-ndk-r17b/platforms/android-16/arch-arm/ -Wl,-soname,libApp.so -Wl,-rpath=C:/Qt/Qt5.11.1/5.11.1/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libApp.so main.obj mainwindow.obj moc_mainwindow.obj -LC:\Users\Robin\android-ndk-r17b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -Lc:/users/robin/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -L../Lib -lLib -LC:/Qt/Qt5.11.1/5.11.1/android_armv7/lib -lQt5Widgets -Lc:\utils\android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -Lc:/utils/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.9 -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc c:/users/robin/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lLib ..\..\SubdirsExample\App/mainwindow.cpp:13: error: undefined reference to 'Lib::greet()' collect2.exe: error: ld returned 1 exit status make[1]: *** [libApp.so] Error 1 make: *** [sub-App-make_first] Error 2 make[1]: Leaving directory `C:/Users/Robin/Documents/build-SubdirsExample-Android_f_r_armeabi_v7a_GCC_4_9_Qt_5_11_1_for_Android_armv7-Debug/App' 14:55:34: Der Prozess "C:\Users\Robin\android-ndk-r17b\prebuilt\windows-x86_64\bin\make.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts SubdirsExample (Kit: Android für armeabi-v7a (GCC 4.9, Qt 5.11.1 for Android armv7)) Bei der Ausführung von Schritt "Make" 14:55:34: Verstrichene Zeit: 00:14.
-
this is the compiler log with "Desktop Qt 5.11.1 MinGW 32bit"
15:19:30: Führe Schritte für Projekt SubdirsExample aus... 15:19:30: Unveränderte Konfiguration, qmake-Schritt wird übersprungen. 15:19:30: Starte "C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\mingw32-make.exe" cd App\ && ( if not exist Makefile C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\qmake.exe -o Makefile C:\Users\Robin\Documents\SubdirsExample\App\App.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" ) && C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/mingw32-make -f Makefile mingw32-make[1]: Entering directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug mingw32-make[2]: Entering directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\uic.exe ..\..\SubdirsExample\App\mainwindow.ui -o ui_mainwindow.h g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\main.o ..\..\SubdirsExample\App\main.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\mainwindow.o ..\..\SubdirsExample\App\mainwindow.cpp g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\features\data\dummy.cpp C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include debug/moc_predefs.h -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/mkspecs/win32-g++ -IC:/Users/Robin/Documents/SubdirsExample/App -IC:/Users/Robin/Documents/SubdirsExample/Lib -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtWidgets -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtGui -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtANGLE -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtCore -I. -IC:/Qt/Qt5.11.1/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include -IC:/Qt/Qt5.11.1/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++ -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward ..\..\SubdirsExample\App\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -Wl,-subsystem,windows -mthreads -o debug\App.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -LC:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libqtmaind.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 -L..\Lib -lLib C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Widgetsd.a C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Guid.a C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Cored.a C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lLib collect2.exe: error: ld returned 1 exit status Makefile.Debug:67: recipe for target 'debug\App.exe' failed mingw32-make[2]: Leaving directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' mingw32-make[2]: *** [debug\App.exe] Error 1 Makefile:36: recipe for target 'debug' failed mingw32-make[1]: Leaving directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' mingw32-make[1]: *** [debug] Error 2 Makefile:41: recipe for target 'sub-App-make_first' failed mingw32-make: *** [sub-App-make_first] Error 2 15:19:49: Der Prozess "C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts SubdirsExample (Kit: Desktop Qt 5.11.1 MinGW 32bit) Bei der Ausführung von Schritt "Make" 15:19:49: Verstrichene Zeit: 00:19.
-
this is the compiler log with "Desktop Qt 5.11.1 MinGW 32bit"
15:19:30: Führe Schritte für Projekt SubdirsExample aus... 15:19:30: Unveränderte Konfiguration, qmake-Schritt wird übersprungen. 15:19:30: Starte "C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\mingw32-make.exe" cd App\ && ( if not exist Makefile C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\qmake.exe -o Makefile C:\Users\Robin\Documents\SubdirsExample\App\App.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" ) && C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/mingw32-make -f Makefile mingw32-make[1]: Entering directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug mingw32-make[2]: Entering directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\uic.exe ..\..\SubdirsExample\App\mainwindow.ui -o ui_mainwindow.h g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\main.o ..\..\SubdirsExample\App\main.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\mainwindow.o ..\..\SubdirsExample\App\mainwindow.cpp g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\features\data\dummy.cpp C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include debug/moc_predefs.h -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/mkspecs/win32-g++ -IC:/Users/Robin/Documents/SubdirsExample/App -IC:/Users/Robin/Documents/SubdirsExample/Lib -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtWidgets -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtGui -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtANGLE -IC:/Qt/Qt5.11.1/5.11.1/mingw53_32/include/QtCore -I. -IC:/Qt/Qt5.11.1/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include -IC:/Qt/Qt5.11.1/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++ -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 -IC:/Qt/Qt5.11.1/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward ..\..\SubdirsExample\App\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\SubdirsExample\App -I. -I..\..\SubdirsExample\Lib -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtWidgets -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtGui -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtANGLE -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\include\QtCore -Idebug -I. -IC:\Qt\Qt5.11.1\5.11.1\mingw53_32\mkspecs\win32-g++ -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -Wl,-subsystem,windows -mthreads -o debug\App.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -LC:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libqtmaind.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 -L..\Lib -lLib C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Widgetsd.a C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Guid.a C:\Qt\Qt5.11.1\5.11.1\mingw53_32\lib\libQt5Cored.a C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lLib collect2.exe: error: ld returned 1 exit status Makefile.Debug:67: recipe for target 'debug\App.exe' failed mingw32-make[2]: Leaving directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' mingw32-make[2]: *** [debug\App.exe] Error 1 Makefile:36: recipe for target 'debug' failed mingw32-make[1]: Leaving directory 'C:/Users/Robin/Documents/build-SubdirsExample-Desktop_Qt_5_11_1_MinGW_32bit-Debug/App' mingw32-make[1]: *** [debug] Error 2 Makefile:41: recipe for target 'sub-App-make_first' failed mingw32-make: *** [sub-App-make_first] Error 2 15:19:49: Der Prozess "C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts SubdirsExample (Kit: Desktop Qt 5.11.1 MinGW 32bit) Bei der Ausführung von Schritt "Make" 15:19:49: Verstrichene Zeit: 00:19.
A big sorry! For some reasons, the following line is missing in SubdirsExample.pro:
App.depends = Lib
Just put it at the end, and re-run qmake, afterwards rebuild all. Should work! :)
-
@aha_1980 said in How can I integrate an existing Qt project in another Qt project:
App.depends = Lib
Thank you so much. On my Android deveice is working. :)
-
@Robin-Hood So please mark this thread as SOLVED now. Thanks!