[Insight-developers] linker won't build new library

M Stauffer (V) mstauff at verizon.net
Fri May 27 20:19:16 EDT 2011


Hi,

I'm having trouble building a test. I'm working in a new experimental
module:
Modules/Registration/Refactoring. So far we've only had templated code
and
it's been working fine. I added a non-templated class today, so added
src/.
I can't get it to build now. It seems the library is not being built (I
don't
see it in MyBuildDir/lib/, which is where it seems it should be?).I'm
getting
this linker error:

Undefined symbols:
  "typeinfo for itk::Array1DToData", referenced from:
      itkArray1DToDataTest(int, char**)in itkArray1DToDataTest.cxx.o
  "itk::Array1DToData::Array1DToData()", referenced from:
      itkArray1DToDataTest(int, char**)in itkArray1DToDataTest.cxx.o

The ctor and some other methods are defined in the cxx file.

Cmake has been setup to build all modules.

Any suggestions? I'm sure I'm missing something simple. Thanks.

Here are some relevant file contents:

Modules/Registration/Refactoring/CMakeLists.txt  looks like:
--------------
project(ITK-RegistrationRefactoring)
set(ITK-RegistrationRefactoring_LIBRARIES ITK-RegistrationRefactoring)
itk_module_impl()
--------------

Modules/Registration/Refactoring/src/CMakeLists.txt looks like:
(I'm not sure about all the target_link_libraries includes)
-------------
set(ITK-RegistrationRefactoring_SRC
itkArray1DToData.cxx
)

add_library(ITK-RegistrationRefactoring
${ITK-RegistrationRefactoring_SRC})
target_link_libraries(ITK-RegistrationRefactoring
${ITK-Registration_LIBRARIES} ${ITK-Optimizers_LIBRARIES}
${ITK-ImageIntensity_LIBRARIES} ${ITK-ImageFunction_LIBRARIES}
${ITK-ImageGrid_LIBRARIES} ${ITK-SpatialObjects_LIBRARIES}
${ITK-Smoothing_LIBRARIES} ${ITK-ImageGradient_LIBRARIES}
${ITK-ImageFeature_LIBRARIES} ${ITK-FiniteDifference_LIBRARIES})
itk_module_target(ITK-RegistrationRefactoring)
--------------

If I change the name of itkArray1DToData.cxx above, cmake complains, so
it's
at least parsing this file.

Modules/Registration/Refactoring/test/CMakeLists.txt looks like:
---------------
itk_module_test()
set(ITK-RegistrationRefactoringTests
  itkDeformationFieldTransformRegistrationTest.cxx
  itkTransformParametersTest.cxx
  itkImageVectorTransformParametersHelperTest.cxx
  itkArray1DToDataTest.cxx
)

CreateTestDriver(ITK-RegistrationRefactoring
"${ITK-RegistrationRefactoring-Test_LIBRARIES}"
"${ITK-RegistrationRefactoringTests}")

<snip other "add_tests">

add_test(NAME itkArray1DToDataTest
         COMMAND ITK-RegistrationRefactoringTestDriver
itkArray1DToDataTest)
--------------


Modules/Registration/Refactoring/itk-module.cmake looks like:
----------------
itk_module(ITK-RegistrationRefactoring DEPENDS ITK-RegistrationCommon
ITK-Optimizers ITK-ImageIntensity ITK-ImageFunction ITK-ImageGrid
ITK-SpatialObjects ITK-Smoothing ITK-ImageGradient ITK-ImageFeature
ITK-FiniteDifference TEST_DEPENDS ITK-TestKernel ITK-Review)
----------------

Thanks,
Michael



More information about the Insight-developers mailing list