# Build error with 64-bit Qt

**URL:** https://discourse.itk.org/t/build-error-with-64-bit-qt/895
**Category:** Engineering
**Created:** [May 3, 2018, 6:02am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895 "2018-05-03T06:02:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Gib](https://discourse.itk.org/user_avatar/discourse.itk.org/gib/32/4124_2.png) [@Gib](https://discourse.itk.org/u/Gib)
#### Post date: [May 3, 2018, 6:02am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/1 "2018-05-03T06:02:55Z")

</div>

I am trying to build a Qt program on Windows7 with 64-bit Qt, ITK and VTK. I have done this before, several years ago, and I suspect that I’ve forgotten a key step.

I’m using a CMakeLists.txt file, and after setting the environment variables appropriately I invoke QtCreator like this:

QtCreator CMakeLists.txt

The build gives 10 errors, all the same:

c:\program files\itk4.8.0\include\itk-4.8\itkMathDetail.h:286: error: C3861: ‘\_mm\_cvtsd\_si64’: identifier not found

Can somebody tell me what causes this error?

Thanks, Gib

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [May 3, 2018, 7:45am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/2 "2018-05-03T07:45:51Z")

</div>

Looks like you **built ITK** with a **non** -64-bit compiler.

---

<div class="post-metadata">

### Author: ![Gib](https://discourse.itk.org/user_avatar/discourse.itk.org/gib/32/4124_2.png) [@Gib](https://discourse.itk.org/u/Gib)
#### Post date: [May 3, 2018, 9:56am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/3 "2018-05-03T09:56:54Z")

</div>

The build in c:\program files\itk4.8.0 is 64-bit.

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)
#### Post date: [May 3, 2018, 10:48am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/4 "2018-05-03T10:48:08Z")

</div>

I had the very same issue a few days ago, and the cause was mixing 32-bit and 64-bit compilations building a remote module against ITK. If you are sure that this is not the cause, then I’m short of ideas.

---

<div class="post-metadata">

### Author: ![Gib](https://discourse.itk.org/user_avatar/discourse.itk.org/gib/32/4124_2.png) [@Gib](https://discourse.itk.org/u/Gib)
#### Post date: [May 3, 2018, 11:35am UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/5 "2018-05-03T11:35:03Z")

</div>

I have given up using QtCreator to build, and instead after setting the various environment variables I’m using  
cmake -G “Visual Studio 10 Win64”  
to create the VS project files - this works. QtCreator is great for straight 32-bit Qt projects, and I know how to link in 32-bit VTK libraries, but adding ITK to the mix makes things more complicated.

---

<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: [May 3, 2018, 12:58pm UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/6 "2018-05-03T12:58:56Z")

</div>

There are some “issues” using QtCreator with CMake as QtCreator likes to make some assumptions about the compiler but I know it is possible because our project uses Qt 5.9/10 and ITK 4.13 and is ONLY built as a 64 bit application. We use ninja as the generator inside of QtCreator on Windows 10 x64 with both the VS2015 and VS2017 toolchains.

Also one can use a 32 bit compiler to generate a 64 bit application. Mostly\* the compiler itself has nothing to do with the ability to create 32 or 64 bit applications.

- if you have a REALLY large project then the 32 bit compiler just may run out of memory when linking. We used the VS2013 community version for years which ONLY had a 32 bit compiler to produce our 64 bit applications.

---

<div class="post-metadata">

### Author: ![Gib](https://discourse.itk.org/user_avatar/discourse.itk.org/gib/32/4124_2.png) [@Gib](https://discourse.itk.org/u/Gib)
#### Post date: [May 3, 2018, 9:46pm UTC](https://discourse.itk.org/t/build-error-with-64-bit-qt/895/7 "2018-05-03T21:46:35Z")

</div>

I have a vague memory of needing to supply a command-line option to cmake when using it inside QtCreator, but it’s fallen to the bottom of the memory pool. I know it’s possible because I built this program some years ago. Anyway, since I can build outside of QtCreator it’s not a serious problem. I can still use QtCreator to edit the ui file, which is its great strength.

I was not aware that I didn’t need “Win64” to build 64-bit programs.
