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  2012  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: Build of seq-2.1.15 with VS 2010 fails.
From: Andrew Johnson <anj@aps.anl.gov>
To: Mark Rivers <rivers@cars.uchicago.edu>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 19 Dec 2013 12:40:52 -0600
Hi Mark,

On 12/19/2013 11:40 AM, Mark Rivers wrote:
> Looking at shareLib.h it looks to me like epicsShareDef is only defined to be anything on VAXC.
> 
> For _WIN32 and __CYGWIN32__ it is the following
> 
> #   define epicsShareDef

Right, so the epicsShareDef marking is not really necessary, but if
seq-2.1.15 has added the variable to a header file that declaration must
be marked with epicsShareExtern which on Windows expands to either

#define epicsShareExtern __declspec(dllexport) extern

or

#define epicsShareExtern __declspec(dllimport) extern

depending on whether the header is being included by a file that will be
part of the same DLL as seq_if.c or must be imported from that DLL.

I guess Ben's issue might be that he has no header file declaring this
variable, so the compiler never gets told whether it's going to be an
import or an export. The solution should thus be to add a suitably
decorated declaration of the variable to an appropriate header file.

I suspect that just marking the definition as epicsShareExtern in the
seq_if.c file may cause problems later.

- Andrew

> -----Original Message-----
> From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Andrew Johnson
> Sent: Thursday, December 19, 2013 10:55 AM
> To: Heesterman, Peter J
> Cc: tech-talk@aps.anl.gov
> Subject: Re: Build of seq-2.1.15 with VS 2010 fails.
> 
> On 12/19/2013 05:37 AM, Heesterman, Peter J wrote:
>> I have built seq-2.1.15 recently (VS2010), and experienced a similar problem.
>>
>> The variable needs to be defined as epicsShareExtern - see attached file.
> 
> I haven't tried building this code on Windows, but I actually think the
> variable should be marked epicsShareDef in the seq_if.c file where it is
> defined, and epicsShareExtern in any header file that declares it.  The
> rules for the various epicsShare* markers are explained in comments at
> the top of the shareLib.h file; marking the seq_if.c version as
> epicsShareExtern would be telling the compiler that the variable is
> defined in some *other* file, but here it is actually being given a
> value so this must be the definition (and hence epicsShareDef).
> 
> - Andrew
> 

-- 
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock

Replies:
Re: Build of seq-2.1.15 with VS 2010 fails. Benjamin Franksen
References:
Re: Build of seq-2.1.15 with VS 2010 fails. Benjamin Franksen
RE: Build of seq-2.1.15 with VS 2010 fails. Heesterman, Peter J
Re: Build of seq-2.1.15 with VS 2010 fails. Andrew Johnson
RE: Build of seq-2.1.15 with VS 2010 fails. Mark Rivers

Navigate by Date:
Prev: RE: Build of seq-2.1.15 with VS 2010 fails. Mark Rivers
Next: Re: Build of seq-2.1.15 with VS 2010 fails. Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: RE: Build of seq-2.1.15 with VS 2010 fails. Mark Rivers
Next: Re: Build of seq-2.1.15 with VS 2010 fails. Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·