# ITK build problems

**URL:** https://discourse.itk.org/t/itk-build-problems/766
**Category:** Engineering
**Created:** [March 14, 2018, 1:37pm UTC](https://discourse.itk.org/t/itk-build-problems/766 "2018-03-14T13:37:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![melrobin](https://discourse.itk.org/user_avatar/discourse.itk.org/melrobin/32/277_2.png) [@melrobin](https://discourse.itk.org/u/melrobin)
#### Post date: [March 14, 2018, 1:37pm UTC](https://discourse.itk.org/t/itk-build-problems/766/1 "2018-03-14T13:37:32Z")

</div>

I would have put this in the issues tracker, but it appears to be down. There have been some recent changes on the [github.com](http://github.com) version of ITK and I can no longer build. In particular the errors relate to the ExceptionObject:  
/home/melrobin/packages/ITK/Modules/Core/Common/include/itkMacro.h:738:5: error:  
variable has incomplete type ‘::itk::ExceptionObject’  
itkGenericExceptionMacro(\<\< "Failed dynamic cast to "  
^  
/home/melrobin/packages/ITK/Modules/Core/Common/include/itkMacro.h:443:28: note:  
expanded from macro ‘itkGenericExceptionMacro’  
::itk::ExceptionObject e\_( **FILE** , **LINE** , message.str().c\_str()…  
^  
/home/melrobin/packages/ITK/Modules/Core/Common/include/itkMacro.h:61:7: note:  
forward declaration of ‘itk::ExceptionObject’  
class ExceptionObject;

Does anyone have an idea of why this behavior could be occurring?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [March 14, 2018, 1:49pm UTC](https://discourse.itk.org/t/itk-build-problems/766/2 "2018-03-14T13:49:41Z")

</div>

The problem is related to this gerrit topic:  
[http://review.source.kitware.com/#/c/23250/](http://review.source.kitware.com/#/c/23250/)

There is the following question still open on how best to fix is:

> This is the only function defined in this file, the rest are just macros To resolve the referenced error the declaration needs to be separated from the definition of the function.  
> Should the definition of the implementation be moved to the end of the file or to a file such as “itkMacro.hxx”?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [March 14, 2018, 5:22pm UTC](https://discourse.itk.org/t/itk-build-problems/766/3 "2018-03-14T17:22:03Z")

</div>

> [@blowekamp](#):
>
> This is the only function defined in this file, the rest are just macros To resolve the referenced error the declaration needs to be separated from the definition of the function.
> 
> Should the definition of the implementation be moved to the end of the file or to a file such as “itkMacro.hxx”?

How about converting it to a macro?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [March 16, 2018, 2:58pm UTC](https://discourse.itk.org/t/itk-build-problems/766/4 "2018-03-16T14:58:49Z")

</div>

Here is a patch to address the issue:

[http://review.source.kitware.com/#/c/23271/](http://review.source.kitware.com/#/c/23271/)
