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

Lydia Ng lng at insightful . com
Fri, 19 Dec 2003 21:46:33 -0800


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.=20

- 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?
>=20
>=20
> Hi,
>=20
> I am getting odd errors under .net2003 using a checkout from today...
>=20
> A small sample:
>=20
> ----
> #include "itkVector.h"
> #include "itkArray.h"
>=20
> int main(int argc, char ** argv)
>    {
>    typedef itk::Vector<double, 3>   VectorType;
>    typedef itk::Array< VectorType > ArrayType;
>=20
>    ArrayType a;
>    a.SetSize(3);
>=20
>    VectorType v;
>    v[0] =3D 1;
>    v[1] =3D 0;
>    v[2] =3D 0;
>    a[0] =3D v;
>    }
> ----
>=20
> Produces the following two errors:
>=20
> 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)
>=20
> 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
>=20
> ----
> Seems like this should work - I thought I had done this in the past, =
but
> can't find any reference code.   Any ideas?
>=20
> The CMakeLists.txt file is
> PROJECT(test)
>=20
> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> IF(USE_ITK_FILE)
>    INCLUDE(${USE_ITK_FILE})
> ENDIF(USE_ITK_FILE)
>=20
> LINK_DIRECTORIES (
>    ${ITK_LIBRARY_PATH}
> )
>=20
> LINK_LIBRARIES (
>    ITKCommon
> )
>=20
> SET ( MAIN_SRCS
> test.cxx
> )
>=20
> ADD_EXECUTABLE( test MAIN_SRCS )
> ----
>=20
> Thanks,
> Stephen
>=20
> --
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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
>=20
>=20
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk . org
> http://www . itk . org/mailman/listinfo/insight-developers