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

Matt McCormick matt at mmmccormick.com
Mon Apr 12 18:39:36 EDT 2010


> 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)
> 

Looks good to me...

> ld: library not found for -lITKCommon
> collect2: ld returned 1 exit status

> 
> What do I have to do to have the compiler find the ITKCommon library?

  make VERBOSE=1

shows the actual commands that are getting executed.  If all is right, there 
should a -L in there that tells the linker where to find the ITK libraries, e.g. 
-L/usr/lib/InsightToolkit




More information about the Insight-users mailing list