ArcGIS SDK for Qt Header files cannot be found by Qt creator

400
13
Jump to solution
3 weeks ago
Labels (2)
youssefayman
New Contributor II

Hello, I am a beginner in Qt, and I just installed the ArcGIS SDK for Qt, but I'm facing a problem. All of the header files from the SDK do not work. It says "file not found."

youssefayman_0-1714429575694.png

I followed the installation guide for Windows here https://developers.arcgis.com/qt/install-and-set-up/, but even the provided sample projects at https://github.com/Esri/arcgis-maps-sdk-samples-qt/tree/main do not work. It is as if Qt is oblivious to the header files' existence. I have a suspicion that the problem may be related to the integration with Qt creator. When I first installed the ArcGIS SDK, it did not create files in the templates folder in Qt because there was no templates folder as I read at a previous entry here. To fix this, I created a folder named "templates" inside the Qt directory and created another folder inside it called "wizards". I then ran the post-install script to do the IDE Integration. When I did this, the ArcGIS project templates have appeared, but when I create any project using them, all of the SDK's header files cannot be found. I hope anyone could help. Thanks!

0 Kudos
1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

Ok based on those messages, there could be two different issues.

First, our Maps SDK for Qt requires the positioning, sensors, and websockets Qt modules. Double check that those are present when you installed Qt. Those are typically listed as additional liraries

Screenshot 2024-04-29 at 5.09.47 PM.png

As for the strange "no such file" problem, that could be a Windows-specific problem we run into on the team ourselves. That (any related problems) happen with very long paths. One way that we deal with that is to drastically shorten the shadow build folder path. Here's an example on my machine. In the projects tab, I changed the "Build directory" to a shorter length than the default.

Screenshot 2024-04-29 at 5.13.12 PM.png

View solution in original post

13 Replies
JamesBallard1
Esri Regular Contributor

Hi @youssefayman. First, welcome! 

Let's see if we can get you up and running. Have you run the setup yet? I assume so but please confirm.

Once that's in place, let's make sure everything is configured properly. When you configure the project, you should see a message like this for CMake:

[cmake] <FindArcGISRuntime.cmake>

[cmake] Found configuration file at /Users/james/.config/EsriRuntimeQt/ArcGIS Runtime SDK for Qt 200.4.0.ini

[cmake] Found ArcGISRuntime installation at /Users/james/ArcGIS_SDKs/Qt200.4.0

or this for qmake:

Project MESSAGE: ArcGIS Maps SDK for Qt - Mac (arm64)
Project MESSAGE: Version 200.4.0

Be on the lookout for any errors that appear during configuring the project. In Qt Creator, selecting Build -> run qmake or Build -> run CMake should configure the project and get the output.

We rely on this configuration so that projects know how to find our headers and link with our libraries.

Let us know how it goes.

0 Kudos
youssefayman
New Contributor II

Hi James! Thanks for replying! I ran the Setup. When I configure a sample qmake project, I do not get these messages.

0 Kudos
JamesBallard1
Esri Regular Contributor

@youssefayman thanks for confirming. Let's check the sample you're using. Since it's qmake, it should have a section like this:

https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/Maps/Disp... 

Can you confirm? That's the internal project file we rely on to find everything.

If it cannot be found, I assume you should get this message:

https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/Maps/Disp... 

0 Kudos
youssefayman
New Contributor II

I got the correct message now:

youssefayman_0-1714433389877.png

But all of the project files give a message that they are not included in the project, and now the QObject header cannot be found:

youssefayman_1-1714433467555.png

 

0 Kudos
JamesBallard1
Esri Regular Contributor

Ok, it sounds like you're on the right track now. I do see something in your screenshots worth pointing out. You are using the Windows MinGW Qt kit, which we don't support. We only support the MSVC 2019 kit on Windows.

Hopefully that gets you all the way up and running. Let me know.

youssefayman
New Contributor II

I changed to MSVC 2019. Thanks for pointing that out, but the same problem happens:

youssefayman_0-1714434533823.png

Also It says that the files are not included in the project even though they are written in the .pro file

 

0 Kudos
JamesBallard1
Esri Regular Contributor

@youssefayman I took a look and that .pro file may be missing a piece.

Does it work ok if you add this:

INCLUDEPATH += $$PWD

I see we do that for iOS and Android, but it's probably needed on all platforms. Let me know if that gets things compiling for you.

https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/Maps/SetM... 

0 Kudos
youssefayman
New Contributor II

I did it but it did not fix the issue. Here is a screenshot for the build issue

youssefayman_0-1714435386330.png

And here is a message that came:

youssefayman_1-1714435425982.png

 

0 Kudos
JamesBallard1
Esri Regular Contributor

Ok based on those messages, there could be two different issues.

First, our Maps SDK for Qt requires the positioning, sensors, and websockets Qt modules. Double check that those are present when you installed Qt. Those are typically listed as additional liraries

Screenshot 2024-04-29 at 5.09.47 PM.png

As for the strange "no such file" problem, that could be a Windows-specific problem we run into on the team ourselves. That (any related problems) happen with very long paths. One way that we deal with that is to drastically shorten the shadow build folder path. Here's an example on my machine. In the projects tab, I changed the "Build directory" to a shorter length than the default.

Screenshot 2024-04-29 at 5.13.12 PM.png