opengisch / OSGeo4A

OSGeo4A is a build environment to cross-compile opensource GIS software for android devices
MIT License
30 stars 22 forks source link

Could NOT find QtCore #60

Closed dannyrs18 closed 4 years ago

dannyrs18 commented 4 years ago

Greetings to all, recently I wanted to download the QField code, and for this I have to download the OSGeo4A library, I have added the necessary configuration for the execution in the distribute.sh script and everything goes very well until the following error described:

CMake Warning at /usr/share/cmake-3.10/Modules/FindQt4.cmake:618 (message):
  /usr/bin/qmake-qt4 reported QT_INSTALL_LIBS as "/usr/lib/x86_64-linux-gnu"
  but QtCore could not be found there.  Qt is NOT installed correctly for the
  target build environment.
Call Stack (most recent call first):
  CMakeLists.txt:78 (find_package)

CMake Error at /usr/share/cmake-3.10/Modules/FindQt4.cmake:626 (message):
  Could NOT find QtCore.  Check --
  /home/jlgranda/Desarrollo/pruebas/build-android/build/qca/v2.2.1/build-x86_64/CMakeFiles/CMakeError.log
  for more details.
Call Stack (most recent call first):
  CMakeLists.txt:78 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/jlgranda/Desarrollo/pruebas/build-android/build/qca/v2.2.1/build-x86_64/CMakeFiles/CMakeOutput.log".

In the requirements Qt5 is listed, and when compiling requires Qt4, I have downloaded the qt4-qmake and libqt4-dev libraries to mitigate such error but after that the error described above appears with Qtcore. The operating system I use is Linux Mint 19.2 tina

m-kuhn commented 4 years ago

Hi @dannyrs18

To develop, it's much easier to not use OSGeo4A and just compile it for desktop first. This way you get quicker testing and interactive debugging almost for free.

Some notes:


It would be good to write down a step by step tutorial for this. It's been on my todo list for a while but I never got around to doing it

jlgranda commented 4 years ago

Great!

dannyrs18 commented 4 years ago

Thank you very much for the prompt response, it was very helpful

jlgranda commented 4 years ago

Hi everybody. I try to compile QField on Fedora Linux 5.5.15-200.fc31.x86_64 This is step by step:

1. Get QField source code

$ git clone https://github.com/opengisch/QField.git

2. Install QGIS development libraries

$ sudo dnf install qgis-devel

3. Open CMakeLists.txt (or qfield.pro) from the QField source code in QtCreator. You will need to adjust the cmake #parameters (or the config.pri if you are using qfield.pro) to point to your local qgis libraries and includes.

Set SET (DEFAULT_LIB_SUBDIR lib64${LIB_SUFFIX})

4. install quickcontrols2

$ sudo dnf install qt5-qtquickcontrols2-devel

5. Download https://github.com/opengisch/OSGeo4A/releases/download/20200302/osgeo4a.tar.gz and unzip into any folder

5.1 Edit config.pri: set #OSGEO4A_DIR = [insert path here]/OSGeo4A

6. Edit qgis.pri, change: $${QGIS_INSTALL_PATH}/lib by $${QGIS_INSTALL_PATH}/lib64

7. build on QtCreator

But :(

>>> I get compiler output:

-------------------------------

g++ -Wl,-rpath,/usr/lib64/ -shared -Wl,-soname,libqgsquick.so.1 -o libqgsquick.so.1.0.0 qgsquickmapcanvasmap.o qgsquickmaptransform.o qgsquickutils.o qgsquickmapsettings.o qgsquickcoordinatetransformer.o qgsquickfeaturelayerpair.o moc_qgsquickmapcanvasmap.o moc_qgsquickmaptransform.o moc_qgsquickutils.o moc_qgsquickmapsettings.o moc_qgsquickcoordinatetransformer.o moc_qgsquickfeaturelayerpair.o -lproj /usr/lib64/libqgis_core.so /usr/lib64/libqgis_analysis.so /usr/lib64/libQt5PrintSupport.so /usr/lib64/libQt5Widgets.so /usr/lib64/libQt5Quick.so /usr/lib64/libQt5Gui.so /usr/lib64/libQt5Xml.so /usr/lib64/libQt5Positioning.so /usr/lib64/libQt5Qml.so /usr/lib64/libQt5Network.so /usr/lib64/libQt5Core.so /usr/lib64/libGL.so -lpthread
/usr/bin/ld: cannot find -lproj make[1]: Leaving directory '/home/jlgranda/NetBeansProjects/proamazonia/build-QField-Desktop-Debug/src/qgsquick' collect2: error: ld returned 1 exit status make[1]: [Makefile:278: libqgsquick.so.1.0.0] Error 1 make: [Makefile:93: sub-src-qgsquick-make_first-ordered] Error 2 11:45:41: The process "/usr/bin/make" exited with code 2. Error while building/deploying project QField (kit: Desktop) When executing step "Make"

-------------------------------

Any advice?

m-kuhn commented 4 years ago

Are you trying to compile to run it on Android or on Linux?

jlgranda commented 4 years ago

I'm try to running QField in Linux, but I fixed the problem. I installed the libproj and others libs. Then for continue build of QField, is needed Build QGIS with Quick Library. I make this libs and finally I can run QField in Linux (Fedora 31 86x64) with QT 5.3.12 in build SO, but I have a new problem. QField started, but when I hint start button "Open local project" any happend.

Then, I try to running on Android and is the new history for .

m-kuhn commented 4 years ago

Great!

The file open dialog has only recently been fixed. Compile the latest master version to get the dialog. Or drag and drop a qgs/qgz file from your file browser (nautilus) into QField.

jlgranda commented 4 years ago

Nice, thank you. I get the last master version, but I note updated into some classes. I try compile with QGIS devel 3.12.3 inside SO and get: featuremodel.cpp:325: error: no member named 'avoidIntersectionsMode' in 'QgsProject'

Which versions in your development environment?

m-kuhn commented 4 years ago

qgis master/nightly (upcoming 3.14).

jlgranda commented 4 years ago

That's ok, I update to Fedora 32 and get QGIS from testing repo

$ sudo dnf copr enable dani/qgis-testing

Now QField compile.

I have a new problem :).

I did install QT 5.14 with QT installer into other path.

I try to compile QField with new QTCreator and QT 5.14, nice compile. But I get the next error at running time

qfield: /usr/lib64/libQt5Core.so.5: version `Qt_5.14' not found (required by .../build-QField-Desktop_Qt_5_14_2_GCC_64bit-Debug/src/app/qfield)

Any Advice?

m-kuhn commented 4 years ago

Why not use the same qt version as the installed qgis?

jlgranda commented 4 years ago

Thank you. Now works on desktop.

jlgranda commented 4 years ago

Hi @m-kuhn, I try compile into Fedora 32 desktop. When I try to compile, at --->

g++ -Wl,-rpath,/usr/lib64/ -Wl,-rpath-link,/usr/lib64 -o qfield main.o qrc_images.o qrc_resources.o qrc_qml.o qrc_translations.o -lproj /usr/lib64/libqgis_core.so /usr/lib64/libqgis_analysis.so ../../3rdparty/tessellate/libtessellate.a -L/home/jlgranda/NetBeansProjects/proamazonia/build-QField-Desktop-Debug/src/app/../core -lcore -L/home/jlgranda/NetBeansProjects/proamazonia/build-QField-Desktop-Debug/src/app/../qgsquick -lqgsquick /usr/lib64/libQt5PrintSupport.so /usr/lib64/libQt5Svg.so /usr/lib64/libQt5OpenGL.so /usr/lib64/libQt5Widgets.so /usr/lib64/libQt5QuickControls2.so /usr/lib64/libQt5Quick.so /usr/lib64/libQt5Gui.so /usr/lib64/libQt5Concurrent.so /usr/lib64/libQt5Xml.so /usr/lib64/libQt5Positioning.so /usr/lib64/libQt5Sql.so /usr/lib64/libQt5Sensors.so /usr/lib64/libQt5Qml.so /usr/lib64/libQt5Network.so /usr/lib64/libQt5Core.so /usr/lib64/libGL.so -lpthread

Get -->

/usr/bin/ld: /usr/lib64/libgdal.so.26: undefined reference to PQfname@RHPG_9.6' /usr/bin/ld: /usr/lib64/libgdal.so.26: undefined reference toPQsetNoticeProcessor@RHPG_9.6'

I follow error on https://github.com/openalpr/openalpr/issues/846, but no works for QField compile. Any advice.

m-kuhn commented 4 years ago

Try removing the PGDG repositories and uninstalling all postgres packages from there.

jlgranda commented 4 years ago

In effect I remove all repos for Postgres (e.g PostgreSQL Yum Repository) and install default PostgreSQL in RPMs. Then, install QGIS 3.13.0-Master desde testing repo dani/qgis-testing and qgis-devel

Now compile. Thank you @m-kuhn.