Unable to add ArcGIS runtime SDK for Qt to existing project

1519
2
Jump to solution
07-15-2020 10:52 AM
Claire_Peterson
Occasional Contributor

Hello, I have been having trouble the last few days trying to add the ArcGIS runtime SDK for Qt to a pre-existing project. I have read through the best practices and how to install on windows multiple times but nothing seems to be working. I am new to Qt/QML/etc so I am still learning how everything functions.

.pro file

#---ESRI Integration ---#

include ("C:\Program Files (x86)\ArcGIS SDKs\Qt100.8\sdk\ideintegration\arcgis_runtime_qml.pri")

QML2_IMPORT_PATH= "C:\Program Files (x86)\ArcGIS SDKs\Qt100.8\sdk\toolkit\Import"
QML2_IMPORT_PATH= "C:\Program Files (x86)\ArcGIS SDKs\Qt100.8\sdk\windows\x64\qml"

QML_IMPORT_PATH+= "C:\Program Files (x86)\ArcGIS SDKs\Qt100.8\sdk\toolkit\Import"

#---End ESRI Integration ---#

I have  #include <QQmlEngine> added to my .cpp file as well.

The import Esri.ArcGISRuntime 100.8 statement in my .qml file does not throw an error but in the application output it says module "Esri.ArcGISRuntime" is not installed.

Qt Creator 4.12.4
Based on Qt 5.14.2 (MSVC 2017, 32 bit)
Using Desktop Qt 5.14.2 MSVC2017 64bit to build/run (testing on desktop computer)
If I use the 32bit to build/run I receive an error LNK1104: cannot open file 'EsriCommonQtd.lib'

					
				
			
			
				
			
			
				
0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Hi Claire -

Regarding the 32-bit build, we only release the 64-bit binaries so I am not surprised you are getting a linker error.

As for 64-bit, we should be able to get this working. It sounds like an issue at runtime, not build time. I think there are a few ways this can be accomplished. First off, I believe QML2_IMPORT_PATH is supposed to be used as an environment variable (not qmake). You could try setting this environment variable in Qt Creator before running - https://doc.qt.io/qt-5/qtqml-syntax-imports.html#qml-import-path 

Otherwise, have you tried adding to the import path in the main.cpp with engine.addImportPath?

https://doc.qt.io/qt-5/qqmlengine.html#addImportPath 

QQmlApplicationEngine appEngine;
appEngine.addImportPath("C:\\Program Files (x86)\\ArcGIS SDKs\\Qt100.8\\sdk\\windows\\x64\\qml");‍‍‍‍

View solution in original post

2 Replies
LucasDanzinger
Esri Frequent Contributor

Hi Claire -

Regarding the 32-bit build, we only release the 64-bit binaries so I am not surprised you are getting a linker error.

As for 64-bit, we should be able to get this working. It sounds like an issue at runtime, not build time. I think there are a few ways this can be accomplished. First off, I believe QML2_IMPORT_PATH is supposed to be used as an environment variable (not qmake). You could try setting this environment variable in Qt Creator before running - https://doc.qt.io/qt-5/qtqml-syntax-imports.html#qml-import-path 

Otherwise, have you tried adding to the import path in the main.cpp with engine.addImportPath?

https://doc.qt.io/qt-5/qqmlengine.html#addImportPath 

QQmlApplicationEngine appEngine;
appEngine.addImportPath("C:\\Program Files (x86)\\ArcGIS SDKs\\Qt100.8\\sdk\\windows\\x64\\qml");‍‍‍‍
Claire_Peterson
Occasional Contributor

Hi Lucas Danzinger‌, thank you for your reply. I switched over to using a 64-bit compiler and the problem ended up being that I did not have it as an environment variable! Thank you for the information and help - I appreciate it.

0 Kudos