<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Dear all:<BR>
<BR>
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. <BR>
<BR>
Here is my CMakeLists.txt:<BR>
<BR>
FIND_PACKAGE(ITK)<BR>IF(ITK_FOUND)<BR> INCLUDE(${ITK_USE_FILE})<BR>ELSE(ITK_FOUND)<BR> MESSAGE(FATAL_ERROR<BR> "ITK not found. Please set ITK_DIR.")<BR>ENDIF(ITK_FOUND)<BR>
ADD_EXECUTABLE(test test.cxx importITK.cpp)<BR>
TARGET_LINK_LIBRARIES(test ITKCommon ITKBasicFilters ITKIO)<BR>
<BR>
<BR>
I think maybe something's wrong about the CmakeLists.txt I wrote.<BR>
<BR>
Thanks a lot.<RTE_TEXT></RTE_TEXT><BR><br /><hr />MSN 9.0 正式版上线,捆绑免费25G网络硬盘! <a href='http://im.live.cn/msn9/' target='_new'>立刻下载!</a></body>
</html>