Search code examples
visual-studiovtkitk

Visual Studio error when ITK and VTK is used


I am doing a project in visual studio 2015When i included ITK and compiled everything ,some errors are occurring

    Error   C3861   '_beginthreadex': identifier not found

    Error   C2039   '_time64': is not a member of '`global namespace''  
    Error   C3861   '_time64': identifier not found     
    Error   C3861   '_mktime64': identifier not found   
    Error   C3861   '_mktime64': identifier not found   
    Error   C3861   '_gmtime64_s': identifier not found 
    Error   C3861   '_localtime64_s': identifier not found  
    Error   C3861   '_mktime64': identifier not found   
    Error   C3861   '_localtime64_s': identifier not found  
    Error   C3861   '_gmtime64_s': identifier not found 
    Error   C2039   '_time64': is not a member of '`global namespace''
    Error   C3861   '_time64': identifier not found 
    Error   C3646   'm_nLastAnimTime': unknown override specifier   
    Error   C4430   missing type specifier - int assumed. Note: C++ does not 
    support default-int 
    Error   C3646   'm_ActiveTime': unknown override specifier  
    Error   C4430   missing type specifier - int assumed. Note: C++ does not 
     support default-int    
    Error   C3646   'm_clkLastTime': unknown override specifier 

But i tried including Visual studio/VC/Include and Visual Studio/VC/bin to the Additional Include Directories,still it is showing the same errors. I also tried changing the Use of MFC and c++ ->code generation ->Runtime Library in configuration properties as well.

I referred this link also,but my problem is not solved.

So i thought may be because of vs2015 instalation problems and tried to build a new project using VTK and ITK in Visualstudio 2017,In there also the same errors are occurring.I have been stuck for weeks ,Can anyone give a solution for my problem?


Solution

  • Are you using this procedure to build ITK and VTK? Are you following this guide to build your own application? Using CMake is the only supported way of using ITK and/or VTK.

    If you cannot use CMake, a workaround is to build a hello world example using CMake and then copy include paths and list of libraries to your main Visual Studio application.