# Can't compile ITKElastix with python bindings:

**URL:** <https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546>\
**Category:** Uncategorized\
**Created:** [December 4, 2022, 8:00pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546 "2022-12-04T20:00:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric](https://discourse.itk.org/user_avatar/discourse.itk.org/eric/32/2034_2.png) [@eric](https://discourse.itk.org/u/eric)\
**Post date:** [December 4, 2022, 8:00pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546/1 "2022-12-04T20:00:37Z")

</div>

Hi,

I started compiling ITKElastix with python bindings but I keep getting errors like these:

```auto
  elxParameterObject: warning(4): ITK type not wrapped, or currently not known: itk::DataObject
  elxParameterObject: warning(4): ITK type not wrapped, or currently not known: itk::SmartPointer< itk::LightObject >
  itkElastixRegistrationMethod: warning(4): ITK type not wrapped, or currently not known: itk::ImageSource< itk::Image< float, 2 > >
  itkElastixRegistrationMethod: warning(4): ITK type not wrapped, or currently not known: itk::ImageSource< itk::Image< float, 3 > >
  itkElastixRegistrationMethod: warning(4): ITK type not wrapped, or currently not known: itk::SmartPointer< itk::LightObject >

```

I’m compiling on Windows with shared libraries enabled. It seems like the issue is that it’s not finding the “include” (I’m not sure what the right terms is).

What are the cmake variables that affect the exporting or importing of other known types?  
What am I missing for the compilation?

Eric

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [December 5, 2022, 2:48pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546/2 "2022-12-05T14:48:38Z")

</div>

What version of ITKElastix are you trying to compile? And what version of ITK are you pairing it with?

@Niels_Dekker @Tom_Birdsong might have more questions or answers 😃

---

<div class="post-metadata">

**Author:** ![Tom\_Birdsong](https://discourse.itk.org/user_avatar/discourse.itk.org/tom_birdsong/32/1894_2.png) [@Tom\_Birdsong](https://discourse.itk.org/u/Tom_Birdsong)\
**Post date:** [December 5, 2022, 2:55pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546/3 "2022-12-05T14:55:05Z")

</div>

Hi @eric , could you please confirm that you have previously built ITK with Python wrappings enabled?

`ITK_WRAP_PYTHON=ON`

---

<div class="post-metadata">

**Author:** ![eric](https://discourse.itk.org/user_avatar/discourse.itk.org/eric/32/2034_2.png) [@eric](https://discourse.itk.org/u/eric)\
**Post date:** [December 7, 2022, 5:31pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546/4 "2022-12-07T17:31:53Z")

</div>

Thanks for the replies.

I have compiled with ITK with `ITK_WRAP_PYTHON=ON` with itk 5.2.1 with ITKElastix v0.13.0.  
I recently noticed that there’s now an official ITK `v5.3.0` tag so I might try and compile with that and see if there are fixes there that I don’t have with ITK 5.2.1 and the older elastix.

---

<div class="post-metadata">

**Author:** ![eric](https://discourse.itk.org/user_avatar/discourse.itk.org/eric/32/2034_2.png) [@eric](https://discourse.itk.org/u/eric)\
**Post date:** [December 8, 2022, 7:22pm UTC](https://discourse.itk.org/t/cant-compile-itkelastix-with-python-bindings/5546/5 "2022-12-08T19:22:48Z")

</div>

I think I just did it wrong, but I guess I don’t know where to go now.  
So I’ve now compiled ITK 5.3 but I have a similar issue.

So what happened is that I compiled ITK with `ITK_WRAP_PYTHON=ON`.  
Then, I try to compile ITKElastix and it doesn’t compile the python porition.

It feels as though there’s some interactions between Elastix and ITKElastix that might stem from the fact that Elastix expects an installed ITK and uses `find_package(ITK)` in it’s cmakelist where as `ITKElastix` expects to build against the ITK source.

And the errors I got before were from me just adding manually the `Wrapping` folder of ITKElastix with `add_subfolder` but that seems like that’s the wrong approach and I don’t know what I’m missing.
