Hi,<div><br></div><div>I am trying to create an array of itk::Matrix. My code is as follows:</div><div><br></div><div><div><br></div><div> typedef itk::Matrix<double, 512, 3> MatrixShapeType;</div><div><span class="" style="white-space:pre">        </span>MatrixShapeType mShapes[10];</div>
<div><span class="" style="white-space:pre">        </span>for (int i = 0; i < numberOfShapes; i++) { </div><div> mShapes[i].Fill(0);</div><div><br></div><div> for (int j = 0; j < numberOfPoints; j++) {</div>
<div><span class="" style="white-space:pre">                        </span>typedef itk::PointSet<double, 3> PointSetType;</div><div><span class="" style="white-space:pre">                        </span>typedef PointSetType::PointType PointType;</div><div><span class="" style="white-space:pre">                        </span>PointType p = s[0]->GetPoint(i);</div>
<div><br></div><div> mShapes[i](j, 0) = p[0];</div><div> mShapes[i](j, 1) = p[1];</div><div> mShapes[i](j, 2) = p[2];</div><div> } </div><div> }</div><div> </div>
<div><span class="" style="white-space:pre">        </span>cout << mShapes[0] << std::endl;</div><div><br></div><div><br></div><div>The error that I keep getting is: </div><div><div>Link:</div><div>2> Creating library C:/Users/trash001/Desktop/Simplex Sphereoids/build/Debug/SimplexSphereoids.lib and object C:/Users/trash001/Desktop/Simplex Sphereoids/build/Debug/SimplexSphereoids.exp</div>
<div>2>main.obj : error LNK2019: unresolved external symbol "public: class vnl_matrix_fixed<double,512,3> & __thiscall vnl_matrix_fixed<double,512,3>::fill(double)" (?fill@?$vnl_matrix_fixed@N$0CAA@$02@@QAEAAV1@N@Z) referenced in function "public: void __thiscall itk::Matrix<double,512,3>::Fill(double const &)" (?Fill@?$Matrix@N$0CAA@$02@itk@@QAEXABN@Z)</div>
<div>2>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall vnl_matrix_fixed<double,512,3>::print(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?print@?$vnl_matrix_fixed@N$0CAA@$02@@QBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<<double,512,3>(class std::basic_ostream<char,struct std::char_traits<char> > &,class vnl_matrix_fixed<double,512,3> const &)" (??$?6N$0CAA@$02@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABV?$vnl_matrix_fixed@N$0CAA@$02@@@Z)</div>
<div>2>C:\Users\trash001\Desktop\Simplex Sphereoids\build\Debug\SimplexSphereoids.exe : fatal error LNK1120: 2 unresolved externals</div><div>2></div><div>2>Build FAILED.</div></div><div><br></div><div><br></div>
<div><br></div><div>I have tried modifying the matrix example code appropriately, and it works fine, and gives the expected outputs. That code is as follows:</div><div><div> typedef itk::Matrix<double, 3, 3> MatrixType;</div>
<div> MatrixType M[3];</div><div> M[0](0,0) = 1.0;</div><div> M[0](0,1) = 2.0;</div><div> M[0](0,2) = 3.0;</div><div> M[0](1,0) = 4.0;</div><div> M[0](1,1) = 5.0;</div><div> M[0](1,2) = 6.0;</div><div> M[0](2,0) = 7.0;</div>
<div> M[0](2,1) = 8.0;</div><div> M[0](2,2) = 9.0;</div><div> </div><div> std::cout << "M: " << M[0] << std::endl;</div><div> M[0].Fill(0);</div><div> std::cout << "M: " << M[0] << std::endl;</div>
<div> cin.get();</div><div> </div></div><div><br></div><div>I use MSVS2010, and my CMakeLists.txt is as follows:</div><div><div># Project Client Server</div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</div><div><br></div><div>
PROJECT( SimplexSphereoids )</div><div><br></div><div>FIND_PACKAGE ( ITK )</div><div>IF ( ITK_FOUND )</div><div> INCLUDE( ${USE_ITK_FILE} )</div><div>ENDIF( ITK_FOUND )</div><div><br></div><div>FIND_PACKAGE ( VTK )</div>
<div>IF ( VTK_FOUND )</div><div> INCLUDE( ${USE_VTK_FILE} )</div><div>ENDIF( VTK_FOUND )</div><div><br></div><div>INCLUDE_DIRECTORIES(${SimplexSphereoids_SOURCE_DIR})</div><div><br></div><div>ADD_EXECUTABLE( SimplexSphereoids main.cpp )</div>
<div><br></div><div>TARGET_LINK_LIBRARIES ( SimplexSphereoids ${ITK_LIBRARIES} ${VTK_LIBRARIES})</div><div><br></div></div><div><br></div><div>- - - Thanks,</div>-- <br>Tanweer Rashid<br>MSVE Dept.<br><div>Old Dominion University</div>
<br>
</div>