EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: EPICS Base 3.14.12.2-rc1 available for testing
From: "Mark Rivers" <[email protected]>
To: "Andrew Johnson" <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Tue, 29 Nov 2011 15:01:11 -0600
Hi Andrew,

Sorry for the previous quick reply, I was on my way out the door.

Here is where WIN32_WINNT is defined for me:

corvette:base-3.14.12.2-rc1/configure/os>grep WIN32_WINNT *
CONFIG_SITE.win32-x86.win32-x86:USR_CFLAGS += /D_WIN32_WINNT=0x0503
CONFIG_SITE.win32-x86.win32-x86:USR_CXXFLAGS += /D_WIN32_WINNT=0x0503

The reason for doing this was discussed in this tech-talk message that I
posted on May 31, 2011:

http://www.aps.anl.gov/epics/tech-talk/2011/msg00993.php

This is part of that message:

*******************************************************************
When I build and run win32-x86 applications build with asyn they link
OK, but they give a run-time error that WSAPoll cannot be found in the
Winsock DLL.

I worked around the problem by modifying sdkddkver.h to set the value to
0x0503 (XP SP3), but this is clearly not the correct solution.

I has originally blamed Microsoft for doing something stupid with VS
Express, but I am coming to the conclusion that we are doing something
wrong in the EPICS build system.

We are assuming that the default build with Visual Studio with the flags
we use will build an application that can run on the host machine.  This
is clearly incorrect.  Microsoft is letting one build an application on
a host OS that can run on other target OS, for example I can build an
application on Windows 7 that will run on XP, etc.

I believe we need to define _WIN32_WINNT in
CONFIG_SITE.win32-x86.win32-x86 or a similar file to declare what
Windows OS we are targeting with our EPICS build.  One may well want to
set this to 0x0503 so that the executable can run on XP, even if it is
being built on a Windows 7 system, for example.
*******************************************************************


Mark


-----Original Message-----
From: Mark Rivers 
Sent: Tuesday, November 29, 2011 1:30 PM
To: 'Andrew Johnson'
Cc: EPICS tech-talk
Subject: RE: EPICS Base 3.14.12.2-rc1 available for testing

Yes, it is in my CONFIG_SITE.win32-x86 I think.  There was a tech-talk
thread on this a while back.  The problem is that if you don't define
_WIN32_WINNT then it picks up a value from one of the Microsoft header
files, and that value may be for a recent Windows release (e.g. Windows
7).  If you use that value you can end up producing a .exe file that
will not run on the machine that built it!

Mark


-----Original Message-----
From: Andrew Johnson [mailto:[email protected]] 
Sent: Tuesday, November 29, 2011 1:13 PM
To: Mark Rivers
Cc: EPICS tech-talk
Subject: Re: EPICS Base 3.14.12.2-rc1 available for testing

Hi Mark,

On 2011-11-29 Mark Rivers wrote:
> corvette:osi/os/WIN32>diff -u osdTime.cpp.orig osdTime.cpp
> --- osdTime.cpp.orig    2011-11-29 11:40:13.304344427 -0600
> +++ osdTime.cpp 2011-11-29 11:41:19.705649538 -0600
> @@ -60,6 +60,8 @@
>  // for mingw
>  #if !defined ( MAXLONGLONG )
>  #define MAXLONGLONG LL_CONSTANT(0x7fffffffffffffff)
> +#endif
> +#if !defined ( MINLONGLONG )
>  #define MINLONGLONG LL_CONSTANT(~0x7fffffffffffffff)
>  #endif

I will apply that change, thanks.


> It also generated this warning, which does not look good:
> 
> cl -c               /nologo /D__STDC__=0 /D_CRT_SECURE_NO_DEPRECATE
> /D_CRT_NONSTDC_NO_DEPRECATE   /Ox /GL   /W3 /w44355
> /D_WIN32_WINNT=0x0503   /MT -DEPICS_DLL_NO    -I. -I..\\O.Common -I.
...
> ..\\..\\..\\src\\libCom\\osi\\os\\WIN32\\osdMutex.c
> osdMutex.c
> ..\..\..\src\libCom\osi\os\WIN32\osdMutex.c(41) : warning C4005:
> '_WIN32_WINNT' : macro redefinition
>         command-line arguments :  see previous definition of
> '_WIN32_WINNT'

Janet and I are trying to work out where your command-line flag 
/D_WIN32_WINNT=0x0503 is coming from because it's not a standard part of
Base.  
Is it from some site-specific configuration you've used?  We don't see
it 
ourselves on win32-x86 builds.

- Andrew
-- 
Optimization is the process of taking something that works and
replacing it with something that almost works, but costs less.
-- Roger Needham


References:
EPICS Base 3.14.12.2-rc1 available for testing Andrew Johnson
RE: EPICS Base 3.14.12.2-rc1 available for testing Mark Rivers
Re: EPICS Base 3.14.12.2-rc1 available for testing Andrew Johnson
RE: EPICS Base 3.14.12.2-rc1 available for testing Mark Rivers

Navigate by Date:
Prev: Re: EPICS Base 3.14.12.2-rc1 available for testing J. Lewis Muir
Next: Re: EPICS Base 3.14.12.2-rc1 available for testing Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: EPICS Base 3.14.12.2-rc1 available for testing Mark Rivers
Next: Re: EPICS Base 3.14.12.2-rc1 available for testing J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·