[Insight-users] Linking problem when using itk
李健
rongx2 at live.cn
Fri Feb 13 14:22:34 EST 2009
Dear all:
I wrote a class to implement some member functions of itk using Linux. The class declaration is in a flie named by importITK.h, and the class definition is in a file named by importITK.cpp. And I wrote a fuction main() in a file named by test.cxx to invoke that class. I included all needed header files in three files. But something's wrong during liking in main() function: undefined reference to member functions of the class I created.
Here is my CMakeLists.txt:
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(test test.cxx importITK.cpp)
TARGET_LINK_LIBRARIES(test ITKCommon ITKBasicFilters ITKIO)
I think maybe something's wrong about the CmakeLists.txt I wrote.
Thanks a lot.
_________________________________________________________________
MSN新版在线社交网络,与您的MSN好友更全面互动!
http://im.live.cn/msn9/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090214/ff7c799d/attachment.htm>
More information about the Insight-users
mailing list