Hi Freddie and Peter,
I am having a Windows build problem I hope you can help me with.
I am working on the TomoPy project which involves tomography reconstruction in Python. Recently I built tomopy from source, which required me to update my Visual Studio 2017 Community installation because it wanted this version of the
runtime.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023
That worked fine, and I was able to build TomoPy with Visual Studio 2017.
However, now I am having problems with Visual Studio 2015 on the same machine. I can build EPICS base fine. However, when I try to build a program of my own that uses the EPICS build system but not EPICS functions in this file I get the
following error:
cl -EHsc -GR -nologo -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -GL -Oy- -W3 -w44355 -w44344 -MT -DEPICS_BUILD_DLL -TP -I. -I../O.Common -I. -I. -I.. -I../../../include/compiler/msvc
-I../../../include/os/WIN32 -I../../../include -IH:/epics/base-3.15.5/include/compiler/msvc -IH:/epics/base-3.15.5/include/os/WIN32 -IH:/epics/base-3.15.5/include -c ../grid.cpp
grid.cpp
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\msxml.h(1506): error C2143: syntax error: missing ')' before 'constant'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\msxml.h(1506): error C2143: syntax error: missing ';' before 'constant'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\msxml.h(1506): error C2059: syntax error: 'constant'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\msxml.h(1506): error C2059: syntax error: ')'
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\msxml.h(1506): error C2238: unexpected token(s) preceding ';'
../grid.cpp(120): warning C4244: '=': conversion from 'float' to 'long', possible loss of data
The code that is being compiled when it fails is this:
#ifdef _WIN32
#include <windows.h>
static LARGE_INTEGER countsPerSecond;
static double getCurrentTime() {
LARGE_INTEGER count;
if (countsPerSecond.QuadPart == 0) QueryPerformanceFrequency(&countsPerSecond);
QueryPerformanceCounter(&count);
return double(count.QuadPart)/countsPerSecond.QuadPart;
}
It is the include <windows.h> that is causing the problem. If I remove it I get different problems because Windows functions are undefined.
The directory with the file causing the problems is c:\program files (x86)\windows kits\10\include\10.0.17763.0. That dates from June 22, 2020, which is when I updated Visual Studio 2017.
Any idea how I can fix this?
Thanks,
Mark