I have soloved the problem. Thanks for this amazing community and especially thanks to Mike.<br><br>Instead of using:<br><br>IF ( ITK_FOUND)<br>    INCLUDE( ${USE_ITK_FILE} )<br>ENDIF( ITK_FOUND)<br><br>I use:<br><br>FIND_PACKAGE(ITK REQUIRED)<br>
INCLUDE_DIRECTORIES(${ITK_INCLUDE_DIRS})<br>LINK_DIRECTORIES(${ITK_LIBRARY_DIRS})<br><br>TARGET_LINK_LIBRARIES (MyReader<br>  ITKCommon ITKIO ITKAlgorithms<br>)<br><br>to get my expected plugin file. <br>Other than &quot;TARGET_LINK_LIBRARIES&quot;, I  also have tried:<br>
SET (PARAVIEW_ADDITIONAL_LIBRARIES<br>
   ${PARAVIEW_ADDITIONAL_LIBRARIES}<br>   ${ITK_LIBRARIES}<br>)<br>There was no error in the compile and link time and I got the expected
.so file. However, when I load this .so file into ParaView as a plugin.
I got an error like this: &quot;undefined symbol:
_ZTIN3itk11LightObjectE)&quot;. This error seems suggest that the ITK libraries aren&#39;t correctly linked.<br><br>I am not familiar with &quot;PARAVIEW_ADDITIONAL_LIBRARIES&quot;. And I can&#39;t find any information about &quot;PARAVIEW_ADDITIONAL_LIBRARIES&quot; in ParaViewUse.cmake and ParaViewConfig.cmake files. Where is this variable defined? Or should I define it by myself? How this works?<br>
<br>Biao<br><br><br><div class="gmail_quote">On Mon, Mar 9, 2009 at 7:05 PM, Mike Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It depends on how you are building your plugin. I use externally built libraries all the time. 2 Things to remember here:<br>
<br>
1: Compile time Includes - you will need to make sure that include_directories(.. ) are called for each directory that needs to be included. The &quot;ITK_USE_FILE&quot; should be setting those includes I believe.<br>
2: Link time libraries - you will need a list of all the external libraries that also need to be linked to your plugin. If you are creating a new reader/writer/filter then that means setting the<br>
<br>
SET (PARAVIEW_ADDITIONAL_LIBRARIES<br>
    ${PARAVIEW_ADDITIONAL_LIBRARIES}<br>
    ${BOOST_FILESYSTEM_LIBRARY}<br>
    ${HDF_LIBRARY}<br>
)<br>
<br>
variable like show above.<br>
<br>
That should get you started.<br>
<br>
Mike<div><div></div><div><br>
<br>
Biao She wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for your help, Michael Jackson! I am a big fan of you. :-)<br>
The problem was in my CMakeLists.txt file. Because I use ITK libraries in my<br>
class, I include<br>
FIND_PACKAGE(ITK REQUIRED)<br>
INCLUDE(${ITK_USE_FILE})<br>
in my CMakeList file.<br>
After I delete those code in my CMakeList file, everything worked fine.<br>
However, if I included those code in the CMakeList file, even if I didn&#39;t<br>
have anything related to ITK in my .cxx file, I still get the same errors as<br>
above mentioned.<br>
Did that suggest ParaView Plug-in can&#39;t use external libraries (i.e. ITK)?<br>
If not, how can I use ITK libraries in a ParaView Plug-in?<br>
Thanks.<br>
<br>
Biao<br>
<br>
<br>
On Mon, Mar 9, 2009 at 2:28 PM, Michael Jackson &lt;<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
wrote:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Are you including the paths to the DICOMParser and DICOMAppHelper header<br>
files? Can you do a &quot;make VERBOSE=1&quot;  to see the entire compile command?<br>
Maybe it is not getting included properly for some reason.<br>
<br>
_________________________________________________________<br>
Mike Jackson                  <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software                    <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer                  Dayton, Ohio<br>
<br>
<br>
<br>
On Mar 9, 2009, at 2:47 PM, Biao She wrote:<br>
<br>
 Yes, I have done that in my .cxx file, but it doesn&#39;t work...<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I also found a strange phenomenon. When I include the header files for<br>
DICOMParser and DICOMAppHelper in the header file of my class, I got an<br>
error said &quot;it can&#39;t find those header files&quot;.<br>
<br>
I am wondering if this is related to the paraview plug-in CMake file. I<br>
use the following code in the CMake file to link the paraview (vtk) library:<br>
FIND_PACKAGE(ParaView REQUIRED)<br>
INCLUDE(${PARAVIEW_USE_FILE})<br>
<br>
Maybe this isn&#39;t enough to link the DICOMParser and DICOMAppHelper in<br>
paraview?<br>
Thanks,<br>
<br>
Biao<br>
<br>
<br>
<br>
On Mon, Mar 9, 2009 at 12:23 PM, Michael Jackson &lt;<br>
<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>&gt; wrote:<br>
In your .cxx file add #include &quot;vtkDICOMImageReaderVector.h&quot; and the other<br>
classes that are just forward declared in the header file.<br>
<br>
_________________________________________________________<br>
Mike Jackson                  <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software                    <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer                  Dayton, Ohio<br>
<br>
<br>
<br>
<br>
On Mar 9, 2009, at 2:17 PM, Biao She wrote:<br>
<br>
Hi everyone. This might be a silly question, but I am really confused.<br>
I am writing a class inherites from vtkDICOMImageReader. In the header<br>
file of vtkDICOMImageReader class, there are some forward declaration of<br>
these classes: vtkDICOMImageReaderVector, DICOMParser and DICOMAppHelper.<br>
The definition of these classes are included in the .cxx file. Normally, I<br>
should be able to use the methods in those classes in my class. However, I<br>
found that whenever I want to use something like<br>
&quot;this-&gt;Parser-&gt;ClearAllDICOMTagCallbacks()&quot; in my class. The compiler gives<br>
me back an error says that &quot;invalid use of undefined type &#39;structure<br>
DICOMParser&quot;. In the above, &quot;Parser&quot; is an instance of DICOMParser. The same<br>
situation also happen to DICOMAppHelper and vtkDICOMImageReaderVector.<br>
Thanks very much for any of your help.<br>
<br>
Biao<br>
</blockquote></blockquote></blockquote>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
--<div><br>
She, Biao<br>
Department of Computing Science,<br>
University of Alberta, Edmonton, Canada<br>
</div></blockquote></blockquote></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>She, Biao<br>Department of Computing Science,<br>University of Alberta, Edmonton, Canada<br>