[ITK] 'type_traits' file not found error, on OS X 10.10 and ITK 4.7.1

Matt McCormick matt.mccormick at kitware.com
Mon Feb 23 14:31:44 EST 2015


Hi Quentan,

Welcome to ITK!

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

Please make sure that these flags are set on your initial
configuration (from an empty build tree) of ITK, e.g.,

cmake -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -std=c++11" ~/src/ITK

If you want build your application as a C++11 application, then ITK
needs to have these flags, too.

HTH,
Matt

On Mon, Feb 23, 2015 at 2:10 PM, Quan Qi <quentan at gmail.com> wrote:
> Dear mailing list members,
>
> I’m running on OS X 10.10 and have successfully compiled ITK 4.7.1(using
> shared library setting). But I always got a ‘type_traits’ error.
>
> /usr/local/itk/include/ITK-4.7/itkImageAlgorithm.h:24:12: fatal error:
> 'type_traits' file not found
>
> My CMakeLists.txt is quite simple:
>
> #####
> cmake_minimum_required(VERSION 2.8.4)
> project(DicomSeriesReadImageWrite2)
>
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -std=c++11")
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
> set(SOURCE_FILES main.cpp)
> add_executable(DicomSeriesReadImageWrite2 ${SOURCE_FILES})
> #####
>
> Change the stdlib to be libc++ leads to this error: Undefined symbols for
> architecture x86_64
>
> I tried to search the same problem in mailing list archive, but issue
> remains. And I referred to this post, but ’tr1/type_traits’ error was
> generated.
>
> I’m new on ITK, can anybody help me?
>
> Cheers,
> Quentan
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>


More information about the Community mailing list