sample project not compliing, map.h not found

8656
20
03-16-2014 03:21 PM
DrewDowling
Occasional Contributor III
Hello
Using Ubuntu 12.4. I've installed the QT runtime SDK and QT creator 5.2.2, the latest ESRI QT runtime SDK for Linux and followed the installation instructions. Installation went fine and I was able to open the ESRI sample project. However when I try to compile it I get an error at the first include statement referencing am esri header file. So for example "#include map.h" gives the error "map.h not found". So how do I reference the ESRI runtime files in QT creator?

I'm new to QT and developing on a Linux environment so I'm probably missing something obvious. Any help greatly appreciated.
0 Kudos
20 Replies
JeanneTrieu
Occasional Contributor
Hi Drew,

Thank you for your interest in the ArcGIS Runtime SDK for Qt.
If I understood you correctly, you followed the instructions on how to do your installation from this link:
https://developers.arcgis.com/qt/guide/how-to-build-on-linux.htm.

So you will also need to source the init file when you open a new terminal window to use ArcGIS Runtime SDK for Qt and start Qt creator from the same terminal: https://developers.arcgis.com/qt/guide/integration-with-qt-creator.htm.

Let me know if you have any question.

Thanks,
0 Kudos
DrewDowling
Occasional Contributor III
Thanks for your help Jean. Your post helped me figure it out. I didn't run QT Creator from the command line. The original project I created still gave the error but when I created a new project from the template it got passed the error. I'm assuming the correct libs were now added to the .pro file.

I did however run into another similar error at this line: #include gl/gl.h
After some research I found out that because I'm running Ubuntu as a VM the graphics drivers for OpenGL are not installed as standard. The fix was to add certain libraries. This post describes what is needed and this was the command I used

sudo apt-get install mesa-common-dev freeglut3 freeglut3-dev libglu1-mesa libglu1-mesa-dev libglui-dev binutils-gold packaging-dev build-essential


I don't think all these libs are needed but this is what worked for me. I'm adding all of this in case it helps others
0 Kudos
RonVincent
Occasional Contributor
I'm getting a similar message except that I'm on Windows 7.

C:\AppDev\Qt\MyFirstApp\MyFirstApp.h:21: error: C1083: Cannot open include file: 'Map.h': No such file or directory
0 Kudos
JeanneTrieu
Occasional Contributor
Hi Ron,

Did you create the project using the template? The following link outlines the steps to integrate the template into the Qt creator: https://developers.arcgis.com/qt/guide/integration-with-qt-creator.htm.

Let me know if this solve the issue.

Regards,
0 Kudos
azzamwahab
New Contributor II
Hello,

I use 32bit Ubuntu 12.04 LTS ..I don't understand with this instruction "Source the init file when you open a new command window or terminal window to use ArcGIS Runtime SDK for Qt."..Can somebody show how to do it? I still getting "Map.h No such file or directory" error.Thanks
0 Kudos
azzamwahab
New Contributor II
Hello,

I use 32bit Ubuntu 12.04 LTS ..I don't understand with this instruction "Source the init file when you open a new command window or terminal window to use ArcGIS Runtime SDK for Qt."..Can somebody show how to do it? I still getting "Map.h No such file or directory" error.Thanks


Nevermind, I found the solution. I follow this guide http://stackoverflow.com/questions/13428910/how-to-set-the-environmental-variable-ld-library-path-in...
0 Kudos
FabianHeredia
New Contributor II

which is the solution of all

0 Kudos
FabianHeredia
New Contributor II

which is the solution when it does not recognize references ArcGIS, i use Ubuntu 64X

0 Kudos
JeanneTrieu
Occasional Contributor

Hi Fabian,

To run code on Linux platforms, including the  ArcGIS Runtime SDK for Qt samples, source the init script for the target platform  before opening Qt Creator. This means that you will need to open a terminal and use one of the following init file depending on the platform that you are on and the type of the terminal that you are using:

- init_sdk_qt64.sh for 64-bit bash,

- init_sdk_qt32.sh for 32-bit bash

- init_sdk_qt64.csh for 64-bit C shell

- init_sdk_qt32.csh for 32-bit C shell.

After that you have ran the above script located in the root folder of your installation, use the same terminal to start your QtCreator. 

Let me know if you have more questions.

Regards,

Jen Trieu

Product Engineer

0 Kudos