Visual Studio RTTI configuration error

Hello,

I am trying install ITK. But getting following errors.
Error 1-
CMake Error at Modules/ThirdParty/VNL/src/vxl/config/cmake/config/VXLIntrospectionConfig.cmake:410 (message):
Compilers that do not support RTTI are not supported

Error 2 -
Call Stack (most recent call first):
Modules/ThirdParty/VNL/src/vxl/CMakeLists.txt:183 (include)

Warning -
Make Warning at CMakeLists.txt:254 (message):
ITKV3_COMPATIBILITY will be removed starting in ITK version 5.0.

I am using Visual Studio C++ compiler here.
Kindly give me solution for this problem.
Thanks in advance.

Hi @Pooja_Virkar,

Welcome to ITK! :sunny:

Did you follow the Configuring and Building ITK section of the ITK Software Guide?

Hello Matt,

Yes I followed the ITK software guide.
But still I am getting those errors.
Should I need to enable RTTI?
But how to do it?
And also I dont understand to solve that error 2 and warning.

Hi @Pooja_Virkar,

Run time type information (RTTI) should be available in Visual Studio by default – this indicates there is some kind of issue with the compiler / compiler recognition / compiler environment.

Please try the following:

  1. Start with a clean build tree.
  2. Start cmake-gui from a Visual Studio command prompt.

What version of Visual Studio and ITK are you using?

Hello,

I am using Microsoft Visual studio community 2017 Version 15.9.7
& ITK version 4.13.1
I am using Windows 10 with 64-bit O.S.
I have one more doubt. should I use “cmake-3.14.0-rc2-win64-x64” or
“cmake-3.14.0-rc2-win32-x86”?

I am new to the ITK.
So Can you please elaborate what is mean by “Clean build tree”? & how to do it?
& I am getting following message after giving cmake-gui command.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>cmake-gui
‘cmake-gui’ is not recognized as an internal or external command,
operable program or batch file.

Please help me by guiding with steps.

Thanks.

:+1: thanks for the information.

Since you have a 64 bit OS, use the 64 bit version. Try cmake-3.13.4-win64-x64.msi.

A clean build tree means deleting all the content of the ITK build folder, e.g. ITK-build.

It is OK to not start CMake from the Visual Studio command prompt; but, pick a Visual Studio CMake generator during the initial configuration that corresponds to the version you have installed.

Please let us know how it goes.

Hello,

I have cleared ITK build folder. And did configuration using cmake-gui by selecting Visual studio 2017 generator.

But now I am getting following error.

CMake Error at C:/Users/pooja virkar/Desktop/Study materials/4th semester/pooja/cmake-3.14.0-rc2-win64-x64/share/cmake-3.14/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler

"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/MyProjects/ITK-bin/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe cmTC_9805a.vcxproj /p:Configuration=Debug /p:Platform=Win32 /p:VisualStudioVersion=15.0 /v:m 
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

  Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86

  Copyright (C) Microsoft Corporation.  All rights reserved.


  cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_9805a.dir\Debug\\" /Fd"cmTC_9805a.dir\Debug\vc141.pdb" /Gd /TP /analyze- /errorReport:queue "C:\MyProjects\ITK-bin\CMakeFiles\CMakeTmp\testCXXCompiler.cxx"

  testCXXCompiler.cxx

  

cl : Command line error D8050: cannot execute 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\c1xx.dll': failed to get command line into debug records [C:\MyProjects\ITK-bin\CMakeFiles\CMakeTmp\cmTC_9805a.vcxproj]

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:28 (project)

Configuring incomplete, errors occurred!
See also “C:/MyProjects/ITK-bin/CMakeFiles/CMakeOutput.log”.
See also “C:/MyProjects/ITK-bin/CMakeFiles/CMakeError.log”.

But then following steps helped me to remove this error.

  1. Right-Click on Properties on cl.exe in your VS install directory (the exact path appears in the CMake error);
  2. Choose the Compatibility Tab;
  3. Check “Run this program as administrator” in the “Privilege Level” box.

After that I again configured it, but now I got following errors.

CMake Error at CMakeLists.txt:28 (project):
No CMAKE_CXX_COMPILER could be found.

CMake Error at CMakeLists.txt:28 (project):
No CMAKE_C_COMPILER could be found.

Configuring incomplete, errors occurred!

See also "C:/MyProjects/ITK-bin/CMakeFiles/CMakeOutput.log".

See also "C:/MyProjects/ITK-bin/CMakeFiles/CMakeError.log".strong text

Please provide solution for the above error.

C:/Users/pooja virkar/Desktop/Study materials/4th semester/pooja/cmake-3.14.0-rc2-win64-x64/share/cmake-3.14/Modules/

Windows has path length issues, so it is recommended to install CMake into a shorter path, e.g. C:\CMake or the standard C:\Program Files\CMake.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86

This is for a 32-bit build. Unless there is a specific reason for a 32-bit build, a 64-bit build is recommended.

Hello,

I did change the path for CMake.
But I couldn’t solve following errors.

CMake Error at CMakeLists.txt:28 (project):
No CMAKE_CXX_COMPILER could be found.

CMake Error at CMakeLists.txt:28 (project):
No CMAKE_C_COMPILER could be found.

Configuring incomplete, errors occurred!

See also “C:/MyProjects/ITK-bin/CMakeFiles/CMakeOutput.log”.

See also “C:/MyProjects/ITK-bin/CMakeFiles/CMakeError.log”.

Please tell me what should I do?

There seems to be something wrong with your Visual Studio installation. Try “repairing” your installation: from Visual Studio Installer click “More”, then “Repair”.

Probably not related, but might be worth checking is disappearance of rc.exe from VS2015 installation.