fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
403 stars 154 forks source link

building limereport for android, without designer #309

Open davidovv opened 3 years ago

davidovv commented 3 years ago

In project readme there is this line:

  1. Added the ability to build only report generator without embedded visual report designer. How do i configure project to exclude report designer

When building for android first error i encounter is qmake complaining about missing QT modules: designer designercomponents-private. I guess those are needed for report designer part. I won't need report designer on android.

Another question is can limereport engine be used without being built as external library, like just include specific .pri file in my project?

fralx commented 3 years ago
  1. "CONFIG+=no_formdesigner" "CONFIG+=no_embedded_designer" should do this trick
  2. limereport.pri
davidovv commented 3 years ago

I have problems for 2. This seamed to work for android and linux, but not for windows. I am using qt mingw 5.12.10. This is compile output for test project that has only main window and included limereport.pri ... g++ -Wl,-subsystem,windows -mthreads -o debug\limeTest.exe @object_script.limeTest.Debug C:\Qt\5.12.10\mingw73_32\lib\libQt5Svgd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5UiToolsd.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib C:\Qt\5.12.10\mingw73_32\lib\libQt5PrintSupportd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5DesignerComponentsd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Designerd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Widgetsd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Guid.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Xmld.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Sqld.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Qmld.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Networkd.a C:\Qt\5.12.10\mingw73_32\lib\libQt5Cored.a -lmingw32 C:\Qt\5.12.10\mingw73_32\lib\libqtmaind.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 win32/debug/obj/lrbarcodeitem.o: In function ZN10LimeReport11BarcodeItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget': C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:66: undefined reference to_imp_ZN4Zint5QZintC1Ev' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:67: undefined reference to `impZN4Zint5QZint7setTextERK7QString' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:68: undefined reference to _imp___ZN4Zint5QZint7setTextERK7QString' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:69: undefined reference to_imp_ZN4Zint5QZint12setInputModeEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:70: undefined reference to `impZN4Zint5QZint9setSymbolEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:71: undefined reference to _imp___ZN4Zint5QZint13setWhitespaceEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:72: undefined reference to_imp_ZN4Zint5QZint10setFgColorERK6QColor' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:73: undefined reference to `impZN4Zint5QZint10setBgColorERK6QColor' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:74: undefined reference to _imp___ZN4Zint5QZint8setWidthEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:75: undefined reference to_imp_ZN4Zint5QZint16setSecurityLevelEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:76: undefined reference to `impZN4Zint5QZint18setPdf417CodeWordsEi' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:77: undefined reference to _imp___ZN4Zint5QZint11setHideTextEb' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:78: undefined reference to_imp_ZN4Zint5QZint10setOption3Ei' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:105: undefined reference to `impZN4Zint5QZint6renderER8QPainterRK6QRectF' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:66: undefined reference to _imp___ZN4Zint5QZintD1Ev' C:\src\build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug/../LimeReport/limereport/items/lrbarcodeitem.cpp:66: undefined reference to_imp___ZN4Zint5QZintD1Ev' collect2.exe: error: ld returned 1 exit status mingw32-make[1]: [Makefile.Debug:876: debug/limeTest.exe] Error 1 mingw32-make[1]: Leaving directory 'C:/src/build-limeTest-Desktop_Qt_5_12_10_MinGW_32_bit-Debug' mingw32-make: [Makefile:38: debug] Error 2 12:32:27: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project limeTest (kit: Desktop Qt 5.12.10 MinGW 32-bit) When executing step "Make"

fralx commented 3 years ago

Fixed. You can check it.

eswizardry commented 3 years ago

To build the project for android just "CONFIG+=no_formdesigner" "CONFIG+=no_embedded_designer" is not enough from Qt 5.14 (Currently I use Qt 5.15.2) due to Qt cannot find the lib (i.e. -lQtZintd). I think the root cause may be related to Multi ABI support which on the new Qt version which Qt will look for lib under the ABI folder (i.e. armeabi-v7a or arm64-v8a) but limereport place lib and output under the "build" folder and the lib generated also suffix with _ARCH (i.e. libQtZintd_armeabi-v7a.so, liblimereportd_armeabi-v7a.so).

Could Not Find C:\workspace\LimeReport\build\5.15.2\limereport\liblimereportd_armeabi-v7a.so C:\Development\SDK\ndk\21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -target armv7a-linux-androideabi21 -fno-limit-debug-info -Wl,-rpath-link=C:/Qt/5.15.2/android/lib -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-soname,liblimereportd_armeabi-v7a.so -o liblimereportd_armeabi-v7a.so @linux32\debug\obj\object_script..Armeabi-v7a -LC:/workspace/LimeReport/build/5.15.2/linux32/debug/lib -lQtZintd C:/Qt/5.15.2/android/lib/libQt5Svg_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5UiTools_armeabi-v7a.a -llog -lz -lm -ldl -lc C:/Qt/5.15.2/android/lib/libQt5PrintSupport_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Widgets_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Gui_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Xml_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Sql_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Qml_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Network_armeabi-v7a.so C:/Qt/5.15.2/android/lib/libQt5Core_armeabi-v7a.so -lGLESv2 -llog -lz -lm -ldl -lc C:\Development\SDK\ndk\21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: error: cannot find -lQtZintd ..\..\..\limereport\items/lrbarcodeitem.cpp:66: error: undefined reference to 'Zint::QZint::QZint()' ..\..\..\limereport\items/lrbarcodeitem.cpp:67: error: undefined reference to 'Zint::QZint::setText(QString const&)' ..\..\..\limereport\items/lrbarcodeitem.cpp:108: error: undefined reference to 'Zint::QZint::~QZint()' ..\..\..\limereport\items/lrbarcodeitem.cpp:68: error: undefined reference to 'Zint::QZint::setText(QString const&)' ..\..\..\limereport\items/lrbarcodeitem.cpp:69: error: undefined reference to 'Zint::QZint::setInputMode(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:70: error: undefined reference to 'Zint::QZint::setSymbol(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:71: error: undefined reference to 'Zint::QZint::setWhitespace(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:72: error: undefined reference to 'Zint::QZint::setFgColor(QColor const&)' ..\..\..\limereport\items/lrbarcodeitem.cpp:73: error: undefined reference to 'Zint::QZint::setBgColor(QColor const&)' ..\..\..\limereport\items/lrbarcodeitem.cpp:74: error: undefined reference to 'Zint::QZint::setWidth(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:75: error: undefined reference to 'Zint::QZint::setSecurityLevel(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:76: error: undefined reference to 'Zint::QZint::setPdf417CodeWords(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:77: error: undefined reference to 'Zint::QZint::setHideText(bool)' ..\..\..\limereport\items/lrbarcodeitem.cpp:78: error: undefined reference to 'Zint::QZint::setOption3(int)' ..\..\..\limereport\items/lrbarcodeitem.cpp:105: error: undefined reference to 'Zint::QZint::render(QPainter&, QRectF const&)' ..\..\..\limereport\items/lrbarcodeitem.cpp:108: error: undefined reference to 'Zint::QZint::~QZint()' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [Makefile:434: ..\linux32\debug\lib\liblimereportd_armeabi-v7a.so] Error 1 make[1]: Leaving directory 'C:/workspace/LimeReport/build/5.15.2/limereport' make: *** [Makefile:95: sub-limereport-make_first-ordered] Error 2 17:13:34: The process "C:\Development\SDK\ndk\21.3.6528147\prebuilt\windows-x86_64\bin\make.exe" exited with code 2. Error while building/deploying project limereport (kit: Android Qt 5.15.2 Clang Multi-Abi) When executing step "Make" 17:13:34: Elapsed time: 00:25.