# SMTK - fatal error: moab/EntityHandle.hpp

**URL:** https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147
**Category:** Using SMTK
**Created:** [August 21, 2018, 7:59pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147 "2018-08-21T19:59:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![chart3388](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@chart3388](https://discourse.kitware.com/u/chart3388)
#### Post date: [August 21, 2018, 7:59pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147/1 "2018-08-21T19:59:01Z")

</div>

Been having this issue for a while with building SMTK against MOAB. We are using MOAB 4.9.0

```auto
/opt/dev/cmb-6.0.0-9d95e0c07b6802176294760e36a4ec53043f70a4/thirdparty/smtk/smtk/mesh/moab/HandleRange.h:20:33: fatal error: moab/EntityHandle.hpp: No such file or directory
compilation terminated.
thirdparty/smtk/smtk/CMakeFiles/smtkCore.dir/build.make:1118: recipe for target 'thirdparty/smtk/smtk/CMakeFiles/smtkCore.dir/attribute/json/jsonHelperFunction.cxx.o' failed
make[2]: *** [thirdparty/smtk/smtk/CMakeFiles/smtkCore.dir/attribute/json/jsonHelperFunction.cxx.o] Error 1

```

Here is the patch I created to fix the issue:

```auto
--- cmb-6.0.0/thirdparty/smtk/CMakeLists.txt	2018-07-16 13:49:23.600893737 -0500
+++ cmb-6.0.0-new/thirdparty/smtk/CMakeLists.txt	2018-07-16 13:57:25.116804837 -0500
@@ -263,7 +263,7 @@
 # Moab is required for building smtk::mesh, as it is the default storage
 # format for meshes.
 find_package(MOAB REQUIRED)
-
+include_directories(${MOAB_INCLUDE_DIRS})
 
 ################################################################################
 # Qt Related Settings

```

Thanks,

Corey

---

<div class="post-metadata">

### Author: ![tj.corona](https://discourse.kitware.com/user_avatar/discourse.kitware.com/tj.corona/32/35_2.png) [@tj.corona](https://discourse.kitware.com/u/tj.corona)
#### Post date: [August 22, 2018, 1:19pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147/2 "2018-08-22T13:19:15Z")

</div>

Thanks Corey! I will try this patch out [just now](https://gitlab.kitware.com/cmb/smtk/merge_requests/1235).

We are happy taking patch fixes for SMTK/CMB; additionally, we encourage the submission of merge requests to the [SMTK](https://gitlab.kitware.com/cmb/smtk) and [CMB](https://gitlab.kitware.com/cmb/cmb) repositories directly. The more external contributors, the better!

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [August 22, 2018, 5:45pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147/3 "2018-08-22T17:45:34Z")

</div>

It would be better to use `target_include_directories` for moab (on the smtkCore target) than to use `include_directories`, which blindly adds moab include dirs to every target.

---

<div class="post-metadata">

### Author: ![tj.corona](https://discourse.kitware.com/user_avatar/discourse.kitware.com/tj.corona/32/35_2.png) [@tj.corona](https://discourse.kitware.com/u/tj.corona)
#### Post date: [October 3, 2018, 5:11pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147/4 "2018-10-03T17:11:01Z")

</div>

Sorry for the delay. I have implemented David’s suggestion [here](https://gitlab.kitware.com/cmb/smtk/merge_requests/1273). Corey, would you mind testing this to see if it solves your issue?

---

<div class="post-metadata">

### Author: ![chart3388](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@chart3388](https://discourse.kitware.com/u/chart3388)
#### Post date: [October 4, 2018, 5:13pm UTC](https://discourse.kitware.com/t/smtk-fatal-error-moab-entityhandle-hpp/147/5 "2018-10-04T17:13:04Z")

</div>

Fixed! Thank you.
