Build error with 64-bit Qt

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

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

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

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.

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.

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.
1 Like

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.