When you build ITK, add<div><div>ITK_USE_REVIEW:BOOL=ON</div><div><br></div>In your project,</div><div>LINK_LIBRARIES(${ITK_LIBRARIES})</div><div><br></div><div><div class="gmail_quote">On Thu, Sep 6, 2012 at 9:24 AM, Michael Xanadu <span dir="ltr">&lt;<a href="mailto:xanadu.michael@googlemail.com" target="_blank">xanadu.michael@googlemail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br>I have a problem linking an ITK class to my project. At first I build the binaries of ITK 3.20 and linked them to my project via CMAKE. What I did was:<br>
<br><br>FIND_PACKAGE(ITK)<br>IF(ITK_FOUND)<br>  INCLUDE(${ITK_USE_FILE})<br>
ELSE(ITK_FOUND)<br>  MESSAGE(FATAL_ERROR &quot;Cannot build without ITK. Please set ITK_DIR.&quot;)<br>ENDIF(ITK_FOUND)<br><br>SET(ITK_LIBS <br>  ITKAlgorithms<br>  ITKBasicFilters <br>  ITKCommon <br>  ITKIO <br>)        <br>

<br>LINK_LIBRARIES(${ITK_LIBS})<br><br><br>Everything works fine. I can compile my project with many ITK classes in use. But then I tried to use <br><br>#include &quot;itkImageKernelOperator.h&quot;<br><br>in my project. Unfortunatelly, the compiler (VS 2010) says:<br>

<br>fatal error C1083: Cannot open include file: &#39;itkImageKernelOperator.h&#39;: No such file or directory<br><br>I found out that the directory C:/Libs/ITK_SRC_3.20.1/Code/Review (with the missing file mentioned above) of the ITK source was missing in the project settings. Don&#39;t know why. So I added following line to CMakeLists.txt:<br>

<br>INCLUDE_DIRECTORIES(C:/Libs/ITK_SRC_3.20.1/Code/Review)<br><br>OK, now it works. The missing file was found by the compiler and everything is fine now. But of course this line is a little bit ugly because I need to know the absolute path to the ITK source.<br>

Does anybody know a better looking solution?<br><br><br>With kind regards,<br>Michael<br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div>