[Insight-users] read image error in Examples

Xi LIANG liangxi1986317 at hotmail.com
Sun Nov 22 18:32:07 EST 2009


Dear all,

Im trying to learn to use ITK by running some samples under Centos 5. I run a read image code from

Examples/DataRepresentation/Image/

When I configue -> generate, the error suggests me to add the following line, then I add it, the command cmake is happy. I found most of examples dont include this line.

cmake_minimum_required(VERSION 2.8)

When I run the generated Makefile >make, it gives me the error of the follwoing:
[  6%] Building CXX object CMakeFiles/Image1.dir/Image1.cxx.o
/home/fsl/ITK/Workspace/test/ReadImage/Image1.cxx:36:22: error: itkImage.h: No such file or directory
/home/fsl/ITK/Workspace/test/ReadImage/Image1.cxx: In function ‘int main(int, char**)’:
/home/fsl/ITK/Workspace/test/ReadImage/Image1.cxx:51: error: ‘itk’ has not been declared

I assume this is because some package or lib is not included properly, then I added the following lines, then >make works fine.
# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})

I guess I didnt compile or include something property, and I shouldnt need to manually add those lines.

--------------------------------
Xi Liang

梁茜
--------------------------------


 		 	   		  
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091123/aa7d0ece/attachment.htm>


More information about the Insight-users mailing list