[Insight-developers] itk::array< itk::vector > - broken?

Stephen R. Aylward aylward at unc . edu
Sat, 20 Dec 2003 12:51:56 -0500


Thanks!

Adding

#include "vnl/vnl_vector.txx"
#include "vnl/vnl_c_vector.txx"

did the trick!

Stephen

Lydia Ng wrote:
> I think I had a similar problem before due to itk::Vector not being one of
> the standard types already instantiated in the vnl library - you might need
> to include vnl/vnl_vector.txx to get an itk::Array (a.k.a) vnl_vector of
> itk::Vector. 
> 
> - Lydia
> 
> 
>>-----Original Message-----
>>From: Stephen R. Aylward [mailto:aylward at unc . edu]
>>Sent: Friday, December 19, 2003 8:18 PM
>>To: insight-developers at public . kitware . com
>>Subject: [Insight-developers] itk::array< itk::vector > - broken?
>>
>>
>>Hi,
>>
>>I am getting odd errors under .net2003 using a checkout from today...
>>
>>A small sample:
>>
>>----
>>#include "itkVector.h"
>>#include "itkArray.h"
>>
>>int main(int argc, char ** argv)
>>   {
>>   typedef itk::Vector<double, 3>   VectorType;
>>   typedef itk::Array< VectorType > ArrayType;
>>
>>   ArrayType a;
>>   a.SetSize(3);
>>
>>   VectorType v;
>>   v[0] = 1;
>>   v[1] = 0;
>>   v[2] = 0;
>>   a[0] = v;
>>   }
>>----
>>
>>Produces the following two errors:
>>
>>test.obj : error LNK2019: unresolved external symbol "public: __thiscall
>>vnl_vector<class itk::Vector<double,3> >::~vnl_vector<class
>>itk::Vector<double,3> >(void)"
>>(??1?$vnl_vector at V?$Vector at N$02 at itk@@@@QAE at XZ) referenced in function
>>"public: __thiscall itk::Array<class itk::Vector<double,3>
>> >::~Array<class itk::Vector<double,3> >(void)"
>>(??1?$Array at V?$Vector at N$02 at itk@@@itk@@QAE at XZ)
>>
>>test.obj : error LNK2019: unresolved external symbol "public: bool
>>__thiscall vnl_vector<class itk::Vector<double,3> >::set_size(unsigned
>>int)" (?set_size@?$vnl_vector at V?$Vector at N$02 at itk@@@@QAE_NI at Z) referenced
>>in function "public: void __thiscall itk::Array<class
>>itk::Vector<double,3> >::SetSize(unsigned int)"
>>(?SetSize@?$Array at V?$Vector at N$02 at itk@@@itk@@QAEXI at Z)
>>C:\aylward\src\itkUNCApplications-VC++\bin\RelWithDebInfo\test.exe :
>>fatal error LNK1120: 2 unresolved externals
>>
>>----
>>Seems like this should work - I thought I had done this in the past, but
>>can't find any reference code.   Any ideas?
>>
>>The CMakeLists.txt file is
>>PROJECT(test)
>>
>>INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
>>IF(USE_ITK_FILE)
>>   INCLUDE(${USE_ITK_FILE})
>>ENDIF(USE_ITK_FILE)
>>
>>LINK_DIRECTORIES (
>>   ${ITK_LIBRARY_PATH}
>>)
>>
>>LINK_LIBRARIES (
>>   ITKCommon
>>)
>>
>>SET ( MAIN_SRCS
>>test.cxx
>>)
>>
>>ADD_EXECUTABLE( test MAIN_SRCS )
>>----
>>
>>Thanks,
>>Stephen
>>
>>--
>>===========================================================
>>Dr. Stephen R. Aylward
>>Associate Professor of Radiology
>>Adjunct Associate Professor of Computer Science and Surgery
>>http://caddlab . rad . unc . edu
>>aylward at unc . edu
>>(919) 966-9695
>>
>>
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers at itk . org
>>http://www . itk . org/mailman/listinfo/insight-developers
> 
>