# Has anyone tried to build Visual Studio C++ 2019

**URL:** <https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561>\
**Category:** Community\
**Created:** [January 29, 2019, 1:56pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561 "2019-01-29T13:56:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [January 29, 2019, 1:56pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/1 "2019-01-29T13:56:26Z")

</div>

Hello everyone,

I saw that Visual Studio 2019 had been released as a preview (actually back in December). Out of curiosity, has anyone tried to build ITK with it and has anyone encountered any problem?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [January 29, 2019, 2:08pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/2 "2019-01-29T14:08:51Z")

</div>

We have see reports in the GitHub issue tracker from a Visual Studio developer (they are using ITK in their regression test suite). The reported issues have been resolved.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [January 29, 2019, 3:44pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/3 "2019-01-29T15:44:44Z")

</div>

Even Visual Studio 2017 is not quite stable yet, so I did not dare try 2019 yet. I had a feeling they will simply declare VS2017 “finished”, publish VS2019, and keep updating it as they had VS2017 so far. This is just my impression, though.

---

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [January 29, 2019, 10:57pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/4 "2019-01-29T22:57:11Z")

</div>

I tried to compile ITK with it and it was failing on some vnl targets. I’ll test it again after the next preview is released 🙂

---

<div class="post-metadata">

**Author:** ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)\
**Post date:** [June 13, 2019, 10:03am UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/5 "2019-06-13T10:03:22Z")

</div>

Hello folks,

I’m digging up the topic to know if any of you has tried VS2019 with ITK5.0 recently?  
I’m wondering if I should update !

Tim

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [June 13, 2019, 1:23pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/6 "2019-06-13T13:23:55Z")

</div>

Yes, I tried it. With default setting, it fails compiling due to [buggy](https://developercommunity.visualstudio.com/content/problem/552999/fatal-error-c1090-pdb-api-call-failed-error-code-3.html) asynchronous writing to debug symbol database. Workaround is to add `/FS` to _CMAKE\_CXX\_FLAGS_ so it reads `/DWIN32 /D_WINDOWS /W3 /GR /EHsc /FS`.

---

<div class="post-metadata">

**Author:** ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)\
**Post date:** [June 13, 2019, 2:39pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/7 "2019-06-13T14:39:19Z")

</div>

Thanks for the follow-up and reporting to VS team Dženan !  
I will give a shot to VS2019, but as always it seems that we have to wait a bit to have a stable VS solution…

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [June 13, 2019, 2:55pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/8 "2019-06-13T14:55:41Z")

</div>

I am building SimpleITK against ITK 4.13.2 on  
[Azure DevOps](https://github.com/SimpleITK/SimpleITK/blob/master/Testing/CI/Azure/azure-pipelines-batch.yml#L9-L28) with [success](https://open.cdash.org/buildSummary.php?buildid=5952647).

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [June 13, 2019, 3:35pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/9 "2019-06-13T15:35:29Z")

</div>

Are you just building SimpleITK against pre-built ITK, or do you build both?

MSVC 16.1.1 (a very recent stable version) was choking on `itkv3p_netlib.pdb` and one other library (if I remember correctly). For some reason, not everyone encounters this. Also, version 16.0.0 was failing on some 200-300 libraries out of default about 600 in ITK. Which means they are making progress, and thus probably aware of the problem.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [June 13, 2019, 3:42pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/10 "2019-06-13T15:42:05Z")

</div>

I am doing the SimpleITK super build so it’s building just about everything including ITK from scratch.

The Azure DevOps image seems to indicate that its running VS 16.0.3+28803.352: [https://github.com/microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2019-Server2019-Readme.md](https://github.com/microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2019-Server2019-Readme.md)

---

<div class="post-metadata">

**Author:** ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)\
**Post date:** [July 6, 2019, 8:02pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/11 "2019-07-06T20:02:43Z")

</div>

Follow-up: I’ve tried with the latest version (16.1.5), and compilation still choke on some libs as described by @dzenanz (netlib, vnl\_algo, etc). The /FS flag workaround works however.

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [August 14, 2019, 8:01pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/12 "2019-08-14T20:01:10Z")

</div>

See :

> <https://github.com/InsightSoftwareConsortium/ITK/pull/1160>

for a potential uniform method of addressing this problem from the ITK master branch.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 16, 2019, 1:22pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/13 "2019-08-16T13:22:27Z")

</div>

Since [PR1165](https://github.com/InsightSoftwareConsortium/ITK/pull/1165) Visual Studio 2019 builds ITK without requiring any special settings.

---

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [August 16, 2019, 3:39pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/14 "2019-08-16T15:39:52Z")

</div>

But we _ **do** _ need to be on ITK Master. When is the next release scheduled?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 16, 2019, 3:46pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/15 "2019-08-16T15:46:58Z")

</div>

5.1.0 is scheduled for November. 5.0.2 for September. See the [milestone](https://github.com/InsightSoftwareConsortium/ITK/milestones) list.

@matt.mccormick @blowekamp does it make sense to back-port [PR1165](https://github.com/InsightSoftwareConsortium/ITK/pull/1165) to 5.0.2? I assume that changes in parts of VXL which we use were minimal. @hjmjohnson can you confirm that?

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [August 16, 2019, 3:58pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/16 "2019-08-16T15:58:07Z")

</div>

The changes to VXL necessary to make VS2019 work should be constrained to the main CMakeLists.txt file, and only a few isolated lines.

---

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [August 16, 2019, 5:32pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/17 "2019-08-16T17:32:54Z")

</div>

Is that going to be back ported to ITK 4.13.3(?)

The major issue I have now is that I have clients trying to compile our source codes with VS 2019 (probably with the default compilers) and ITK is failing to compile with no real way to get them out of the hole that they find themselves in.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 16, 2019, 6:04pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/18 "2019-08-16T18:04:10Z")

</div>

The actual [changes](https://github.com/vxl/vxl/commit/c2427965d9a6ca41a007167079fd0636505eb285) are super small, and should probably be easy to back-port them even to 4.13.3. But VXL underwent a major refactoring for ITKv5, including the build system, so I am not sure it is trivial.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 16, 2019, 7:21pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/19 "2019-08-16T19:21:04Z")

</div>

OK, I will try back-porting this to 5.0.2 and 4.13.3.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [August 16, 2019, 9:36pm UTC](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561/20 "2019-08-16T21:36:03Z")

</div>

I had been building SimpleITK (against ITKv4) in Release mode with VS2019 on Azure Pipelines OK. I believe that release mode was free of the debug symbol database bug. Recently a new [compilation error](https://open.cdash.org/viewBuildError.php?buildid=6061360) started to occur with the following GDCM::

```auto
error C3848: expression having type 'const gdcm::dircos_comp' would lose some const-volatile qualifiers in order to call 'bool gdcm::dircos_comp::operator ()(const gdcm::dircos_key &,const gdcm::dircos_key &)'

```

I may look into back porting a fix to ITK 4.13 as well.

[Next page](https://discourse.itk.org/t/has-anyone-tried-to-build-visual-studio-c-2019/1561.md?page=2)
