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

Stephen R. Aylward aylward at unc . edu
Fri, 19 Dec 2003 23:18:29 -0500


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