[Insight-users] [insight-users]itkZeroFluxNeumannPadImageFilterTest got errors when generating executable file.
David Doria
daviddoria at gmail.com
Tue Dec 6 08:33:36 EST 2011
n Tue, Dec 6, 2011 at 8:22 AM, Mengqiu Tian <tianmengqiu at gmail.com> wrote:
> Hi all,
>
> I got errors when I try to compile the
> itkZeroFluxNeumannPadImageFilterTest.cxx.
> The error information as follows:
>
> Linking CXX executable itkZeroFluxNeumannPadImageFilterTest
> gcc/x86_64-suse-linux/4.5/../../../../lib64/crt1.o: In function `_start':
> packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:109: undefined
> reference to `main'
> collect2: ld returned 1 exit status
> make[2]: *** [itkZeroFluxNeumannPadImageFilterTest] Error 1
> make[1]: *** [CMakeFiles/itkZeroFluxNeumannPadImageFilterTest.dir/all] Error
> 2
> make: *** [all] Error 2
>
> I just copied the itkZeroFluxNeumannPadImageFilterTest.cxx from
> ~/ITK/Modules/Filtering/ImageGrid/test and I wrote my own CMakeLists.cxx as
> follows:
>
> cmake_minimum_required(VERSION 2.6)
>
> project(itkZeroFluxNeumannPadImageFilterTest)
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
> add_executable(itkZeroFluxNeumannPadImageFilterTest
> itkZeroFluxNeumannPadImageFilterTest.cxx)
>
> if( "${ITK_VERSION_MAJOR}" LESS 4 )
> target_link_libraries(itkZeroFluxNeumannPadImageFilterTest ITKReview
> ${ITK_LIBRARIES})
> else( "${ITK_VERSION_MAJOR}" LESS 4 )
> target_link_libraries(itkZeroFluxNeumannPadImageFilterTest
> ${ITK_LIBRARIES})
> endif( "${ITK_VERSION_MAJOR}" LESS 4 )
>
> Is it a bug or something else?
>
>
> Regards,
> Mengqiu
You just need to rename the main test function
(itkZeroFluxNeumannPadImageFilterTest) to main().
David
More information about the Insight-users
mailing list