[ITK] ITK 4.7 + VTK 6.1 leads to "Undefined symbols for architecture x86_64"

Quan Qi quentan at gmail.com
Tue Feb 24 10:56:26 EST 2015


Dear community members,

I’m trying to read DICOM series with ITK and render the volume with VTK. The single use of VTK is able to render the volume, but once ITK is included, an “Undefined symbols for architecture x86_64” compilation error is produced:

Undefined symbols for architecture x86_64:
  "vtkRenderingOpenGL_AutoInit_Destruct()", referenced from:
      vtkRenderingCore_AutoInit::~vtkRenderingCore_AutoInit() in test1.cxx.o
...

I’m running on OS X 10.10, I want to know how to adjust included libraries to avoid this errors?

CMakeLists.txt

#### CMakeLists.txt start

cmake_minimum_required(VERSION 2.8.4)
project(VolumeShow2)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -std=c++11")

find_package(ITK REQUIRED) # these 2 lines leads to the undefined symbols error
include(${ITK_USE_FILE})

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

add_executable(test1 MACOSX_BUNDLE test1.cxx)

target_link_libraries(test1 ${Glue} ${VTK_LIBRARIES} ${ITK_LIBRARIES})
# target_link_libraries(test1 ${VTK_LIBRARIES} ${ITK_LIBRARIES} vtkRenderingVolume vtkRenderingOpenGL vtkRenderingVolumeOpenGL) # this call helps the project pass the compilation, but leaves an error when executing: no override found for 'vtkRayCastImageDisplayHelper'.

#### CMakeLists.txt end

I am confused about the integration of ITK and VTK. Can anybody help me?

Cheers,
Quentan


More information about the Community mailing list