Qt SDK not working on Linux

4134
5
09-12-2013 07:13 AM
DavidGuzman_Garcia
New Contributor
Hi,

We have installed ArcGIS Qt SDK on LinuxMint 15 with Qt 4.8 and qtcreator 2.8. We are not able to create a basic example using QtCreator we get the following error:

/home/david/build-untitled1-Desktop_Qt_4_8_5-Debug/..untitled1/mainwindow.cpp:16: undefined reference to `EsriRuntimeQt::Map::create(QWidget*)'
/home/david/build-untitled1-Desktop_Qt_4_8_5-Debug/../untitled1/mainwindow.cpp:23: undefined reference to `EsriRuntimeQt::ArcGISRuntime::installDirectory()'
collect2: error: ld returned 1 exit status
make: *** [arcgis_runtime_sdk_10_2_for_qt_application] Error 1

And this is our .pro file :

#-------------------------------------------------
#
# Project created by QtCreator 2013-02-20T10:13:43
#
#-------------------------------------------------

QT += core gui opengl xml network

TARGET = arcgis_runtime_sdk_10_2_for_qt_application
TEMPLATE = app

win32:CONFIG += \
embed_manifest_exe

# This variable should be set to x86_64 or x86 based on 64 or 32 bit Targets respectively.
QMAKE_TARGET.arch = $$(BUILD_ARCH)

unix:QMAKE_CXXFLAGS+=--std=c++0x

INCLUDEPATH += /opt/ArcGis/arcgis/runtime_sdk/qt10.2/sdk/include

contains(QMAKE_TARGET.arch, x86):{
unix:LIBS += \
-L/usr/lib
win32:{
LIBS += \
-L"$$(ARCGISRUNTIMESDKQT_10_2)"/ArcGISRuntime10.2/Client32
CONFIG(debug, debug|release) {
LIBS += \
-lEsriRuntimeQtd
} else {
LIBS += \
-lEsriRuntimeQt
}
}
}
else {
unix:LIBS += \
-L/usr/lib64 \
-L/opt/ArcGis/arcgis/runtime_sdk/qt10.2/ArcGISRuntime10.2/ClientLx/libEsriRuntimeQt.so

win32:{
LIBS += \
-L"$$(ARCGISRUNTIMESDKQT_10_2)"/ArcGISRuntime10.2/Client64
CONFIG(debug, debug|release) {
LIBS += \
-lEsriRuntimeQtd
} else {
LIBS += \
-lEsriRuntimeQt
}
}
}

SOURCES += main.cpp \
mainwindow.cpp

HEADERS += mainwindow.h

Best regards,

David
0 Kudos
5 Replies
JeanneTrieu
Occasional Contributor
Hi David,

To run code on Linux platforms, including the ArcGIS Runtime SDK for Qt samples, source the init script before opening Qt Creator. The init SDK script file is init_sdk_qt.sh for bash and init_sdk_qt.csh for C shell. It's installed to <ArcGIS Runtime SDK for Qt installation directory>. By default, this directory is arcgis/runtime_sdk/qt10.2. You will need to user the same terminal that you used to source your script to start QtCreator.
Please note that we are currently only supporting Ubuntu and Red Hat on Linux.

Let me know if you have any other issues.

Regards,
0 Kudos
DavidGuzman_Garcia
New Contributor
Hi Jean,

Thanks for your help. Now everything is working fine. I moved to the right Ubuntu version (12.04) and started using the script.

David
0 Kudos
JeanneTrieu
Occasional Contributor
Hi David,

I am glad that it is now working. Let me know if you are running into any issues. Thank you again for your feedbacks.

Regards,
0 Kudos
cuongha
New Contributor
Hi Jean!

When i build my app, i get a error follow:

cannot find -lEsriRuntimeQt
-ld returned 1 exit status

I am using QtCreator 3.0 and this is mymap.pro:

TARGET = MyMap
TEMPLATE = app

QT += core gui opengl xml network

greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
}

CONFIG += c++11 esri_runtime_qt_10_2
INCLUDEPATH += "/home/cuonghk/arcgis/runtime_sdk/qt10.2/sdk/include/"

win32:CONFIG += \
  embed_manifest_exe


SOURCES += \
main.cpp \
        MyMap.cpp

HEADERS += \
MyMap.h

Can you help me fix it?

Thank for regard!
0 Kudos
JeanneTrieu
Occasional Contributor
Hi Jean!

When i build my app, i get a error follow:

cannot find -lEsriRuntimeQt
-ld returned 1 exit status

I am using QtCreator 3.0 and this is mymap.pro:

TARGET = MyMap
TEMPLATE = app

QT += core gui opengl xml network

greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
}

CONFIG += c++11 esri_runtime_qt_10_2
INCLUDEPATH += "/home/cuonghk/arcgis/runtime_sdk/qt10.2/sdk/include/"

win32:CONFIG += \
  embed_manifest_exe


SOURCES += \
main.cpp \
        MyMap.cpp

HEADERS += \
MyMap.h

Can you help me fix it?

Thank for regard!


Hi,

Please follow the steps from this link to set up your Linux environment:

https://developers.arcgis.com/qt/guide/how-to-build-on-linux.htm.

Let me know if you have more questions.

Regards,
0 Kudos