[Insight-users] Noob question, but I have to

Boris Shabash bshabash at hotmail.com
Mon Apr 12 17:08:17 EDT 2010


Hello everyone

I am currently working on a class project requiring ITK. I created the
binary using cmake and am working with the first example.

I created a folder called "HelloWorldFolder" on my mac and inside created a
CmakeLists.txt file with the following:
PROJECT(HelloWorld)

FIND_PACKAGE(ITK)
IF (ITK_FOUND)
	INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
	MESSAGE(FATAL_ERROR
			  "ITK not found. Please set ITK_DIR.")
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(HelloWorld HelloWorld.cxx)

TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)


I also created a file called HelloWorld.cxx and in it I wrote:
#include "itkImage.h"
#include <iostream>

int main()
{
	typedef itk::Image<unsigned short, 3> ImageType;
	
	ImageType::Pointer image = ImageType::New();
	
	std::cout<<"ITK HELLOW WORLD!"<<std::endl;
	
	return 0;
}


Then I type "ccmake ." in the folder and do all the configurations, then I
type "make" and get the following error:

Scanning dependencies of target HelloWorld
[100%] Building CXX object CMakeFiles/HelloWorld.dir/HelloWorld.o
Linking CXX executable HelloWorld
ld: library not found for -lITKCommon
collect2: ld returned 1 exit status
make[2]: *** [HelloWorld] Error 1
make[1]: *** [CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [all] Error 2

What do I have to do to have the compiler find the ITKCommon library?
-- 
View this message in context: http://old.nabble.com/Noob-question%2C-but-I-have-to-tp28219187p28219187.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list