<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>
&nbsp;<BR>
I wrote a class to implement some member functions&nbsp;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&nbsp;something's wrong&nbsp;during liking in main() function: undefined reference to member functions of the class I created. <BR>
&nbsp;<BR>
Here is my CMakeLists.txt:<BR>
&nbsp;<BR>
FIND_PACKAGE(ITK)<BR>IF(ITK_FOUND)<BR>&nbsp; INCLUDE(${ITK_USE_FILE})<BR>ELSE(ITK_FOUND)<BR>&nbsp; MESSAGE(FATAL_ERROR<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "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>
&nbsp;<BR>
&nbsp;<BR>
I think maybe something's wrong about the CmakeLists.txt I wrote.<BR>
&nbsp;<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>