unresolved external symbol with cmake
<p>I am trying to create a .dll with cmake .Below is my cmakelists.txt</p>

<pre><code># This is the root ITK CMakeLists file.
cmake_minimum_required(VERSION 2.8.9)
if(COMMAND CMAKE_POLICY)
  cmake_policy(SET CMP0003 NEW)
endif()

SET(BUILD_SHARED_LIBS TRUE)

SET(ITK_LIBRARIES
    ITKIO 
    ITKCommon
    ITKNumerics
    ITKStatistics
    ITKBasicFilters
)

# The header files
SET(HEADERS
  itkLookAtTransformInitializer.h
  itkObliqueSectionImageFilter.h
  obliquePlane.h
)

# The implementation files
SET(SOURCES
  itkLookAtTransformInitializer.txx
  itkObliqueSectionImageFilter.txx
  main.cxx
  obliquePlane.cpp
)

# Find ITK.
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

# Add this as include directory
INCLUDE_DIRECTORIES(
  ${CMAKE_SOURCE_DIR}
  ${SOURCE_PATH}
  ${VXL_INCLUDE_DIRS}
)

LINK_DIRECTORIES(${ITK_LIBRARIES})
# Main library
#ADD_EXECUTABLE(LookAtMain ${HEADERS} ${SOURCES})
ADD_LIBRARY(ObliquePlane SHARED   ${HEADERS} ${SOURCES})
TARGET_LINK_LIBRARIES(ObliquePlane ${ITK_LIBRARIES})
</code></pre>

<p>I am new to both cmake and itk I am getting the following error when i build it:</p>

<pre><code>obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::GE5ImageIOFactoryRegister__Private(void)" (__imp_?GE5ImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::GE4ImageIOFactoryRegister__Private(void)" (__imp_?GE4ImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::MRCImageIOFactoryRegister__Private(void)" (__imp_?MRCImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::MetaImageIOFactoryRegister__Private(void)" (__imp_?MetaImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::BioRadImageIOFactoryRegister__Private(void)" (__imp_?BioRadImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::StimulateImageIOFactoryRegister__Private(void)" (__imp_?StimulateImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::VTKImageIOFactoryRegister__Private(void)" (__imp_?VTKImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::TIFFImageIOFactoryRegister__Private(void)" (__imp_?TIFFImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::PNGImageIOFactoryRegister__Private(void)" (__imp_?PNGImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::LSMImageIOFactoryRegister__Private(void)" (__imp_?LSMImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::BMPImageIOFactoryRegister__Private(void)" (__imp_?BMPImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::GDCMImageIOFactoryRegister__Private(void)" (__imp_?GDCMImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::JPEGImageIOFactoryRegister__Private(void)" (__imp_?JPEGImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::HDF5ImageIOFactoryRegister__Private(void)" (__imp_?HDF5ImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::GiplImageIOFactoryRegister__Private(void)" (__imp_?GiplImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::NrrdImageIOFactoryRegister__Private(void)" (__imp_?NrrdImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466dff@itk@@YAXXZ)
2&gt;obliquePlane.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::NiftiImageIOFactoryRegister__Private(void)" (__imp_?NiftiImageIOFactoryRegister__Private@itk@@YAXXZ) referenced in function "void __cdecl itk::`anonymous namespace'::`dynamic initializer for 'ImageIOFactoryRegisterRegisterList''(void)" (??__EImageIOFactoryRegisterRegisterList@?A0x44466
</code></pre>