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

Luis Ibanez luis.ibanez at kitware.com
Sun May 29 08:53:49 EDT 2011


Hi Michael,

0) You are using the test signature:

          itkArray1DToDataTest(int, char**)

     while, it should be:

          itkArray1DToDataTest(int, char* [])

     as in

   itkArray1DToDataTest(int argc, char * argv [] )


1) Are you building Shared Libraries ?

If so,


2) Did you put the EXPORT symbol in the
    declaration of the Array1DToData class ?


3) Is your code in a place where we could take a look ?



   Thanks


          Luis


-------------------------------------------------------------
On Fri, May 27, 2011 at 8:19 PM, M Stauffer (V) <mstauff at verizon.net> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list