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: [email protected] [mailto:[email protected]] On Behalf Of Andrew Johnson
> Sent: Thursday, December 19, 2013 10:55 AM
> To: Heesterman, Peter J
> Cc: [email protected]
> 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
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- 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
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|