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  2011  <20122013  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  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: asyn driver on Windows XP
From: Pavel Masloff <[email protected]>
To: Mark Rivers <[email protected]>
Cc: EPICS Tech Talk <[email protected]>
Date: Mon, 5 Mar 2012 17:53:35 +0400
Hi Mark,

Before I got your message I had deliberately tried to edit the sdkddkver.h and set _WIN32_WINNT to 0x0400. Which worked!
I had better do it your way. Will do!
Thank you very much!!!

- Pavel

On Mon, Mar 5, 2012 at 5:49 PM, Mark Rivers <[email protected]> wrote:
Hi Pavel,

The support for serial ports on Windows is a separate issue, it is not related to the problem you are having.

The problem arises because when you build a Windows executable you need to specify what operating system versions you want your executable to be able run on (NT, XP, Vista, Windows 7, etc.).  This can be different from the version of the operating system that you are building on.

The problem is that if you do not specify the version with the /D_WIN32_WINNT on the compiler command line, the compiler does not make the "reasonable" assumption that you are building for the OS version that the compiler is running on.  Rather it uses that value in some Microsoft include file to determine the default version, and that is often an OS version that is more recent (e.g. Windows 7) than the one you are running (e.g. XP).  The result is that you will create an executable that cannot be run on the system that built it!

I think this does not happen when building with the Visual Studio IDE because that must default to a command line option which is the OS version on the development system.

The fix is simple.  Add the following lines to your epics/base/configure/os/CONFIG_SITE.win32-x86.win32-x86 file:

# Set the minimum version of Windows on which you want your applications to run
# 0x0503 = XP SP3
# 0x0600 = Vista
# 0x0601 = Windows 7
USR_CFLAGS += /D_WIN32_WINNT=0x0503
USR_CXXFLAGS += /D_WIN32_WINNT=0x0503

Thus, in my case I have set the flag to 0x503, which means that my EPICS executables will run on XP SP3 and higher.  This means they will not use WSA_POLL, because that was not present in XP.

Mark


________________________________
From: [email protected] [[email protected]] on behalf of Pavel Masloff [[email protected]]
Sent: Monday, March 05, 2012 7:35 AM
To: EPICS Tech Talk
Subject: RE: asyn driver on Windows XP

Hello all,


I have been reading a thread (dated May 2011) about the problem with the asyn driver on Windows XP (sp3) after running into the same thing:
I have installed asyn, and some device support drivers that use asyn. Despite the fact everything compiles, the executable files come up with a mistake (sth like: can't find the function WSAPoll in WS2_32.dll).
So, I have not yet understood what is the solution to this problem? I can see in the ASYN release notes "August 2011 : Added support for local serial ports on Windows, i.e.win32-x86" (if this was the issue).
Do I have to set _WIN32_WINNT to 0x0400 (the initial value being 0x0600)??
I need your help!

--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Phone: +7 (812) 461 01 01



--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Phone: +7 (812) 461 01 01


References:
RE: asyn driver on Windows XP Pavel Masloff
RE: asyn driver on Windows XP Mark Rivers

Navigate by Date:
Prev: RE: asyn driver on Windows XP Mark Rivers
Next: TDS 3000 on win32-x86 Pavel Masloff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: asyn driver on Windows XP Mark Rivers
Next: TDS 3000 on win32-x86 Pavel Masloff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  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 ·