Hi Ben,
I normally build statically on win32-x86, so I don't have a lot of experience with ensuring that the functions are visible in DLLs. However, I know that I did make it work with the asynPortDriver class in asyn, and this is what I did:
/** Base class for asyn port drivers; handles most of the bookkeeping for writing an asyn port driver
* with standard asyn interfaces and a parameter library. */
class epicsShareFunc asynPortDriver {
public:
asynPortDriver(const char *portName, int maxAddr, int paramTableSize, int interfaceMask, int interruptMask,
int asynFlags, int autoConnect, int priority, int stackSize);
virtual ~asynPortDriver();
virtual asynStatus lock();
virtual asynStatus unlock();
virtual asynStatus getAddress(asynUser *pasynUser, int *address);
virtual asynStatus readInt32(asynUser *pasynUser, epicsInt32 *value);
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
virtual asynStatus readUInt32Digital(asynUser *pasynUser, epicsUInt32 *value, epicsUInt32 mask);
virtual asynStatus writeUInt32Digital(asynUser *pasynUser, epicsUInt32 value, epicsUInt32 mask);
...
So it was sufficient to declare the class with epicsShareFunc, not the individual methods. I am quite sure that my test application that uses this class linked fine when building dynamically.
Mark
________________________________
From: [email protected] on behalf of Benjamin Franksen
Sent: Fri 12/16/2011 6:04 AM
To: Josh Stein
Cc: [email protected]; [email protected]
Subject: Re: Sequencer build errors on Windows
On Wednesday, December 07, 2011, Josh Stein wrote:
> Hello Benjamin and community,
>
> I am attempting to build version 2.1.3 of the sequencer on a windows
> machine. I have the MinGW tools installed along with a windows version
> of re2c. I have also already successfully built EPICS base, the example
> app and an older version of the sequencer (2.0.14) in the past.
>
> When executing the build from the 2.1.3 top level directory, the
> following warnings and errors are shown and the make is stopped:
>
>
>
> ../../../include/pv.h:75:37: warning: inline function 'pvSystem*
> pvSystem::getSystem()' declared as dllimport: attribute ignored
> [-Wattributes]
> ../../../include/pv.h:77:35: error: function 'pvStat pvSystem::attach()'
> definition is marked dllimport
> ../../../include/pv.h:78:35: error: function 'pvStat pvSystem::flush()'
> definition is marked dllimport
I would like to pose this question to the community, especially the C++
experts.
These are the relevant lines:
class pvSystem {
public:
epicsShareFunc pvSystem( int debug = 0 );
epicsShareFunc virtual ~pvSystem();
epicsShareFunc inline pvSystem *getSystem() { return this; }
epicsShareFunc virtual pvStat attach() { return pvStatOK; }
epicsShareFunc virtual pvStat flush() { return pvStatOK; }
...
}
The code in the src/pv subsystem in the sequencer uses 'epicsShareFunc' for
C++ class methods in many places (also in the method implementations). While
it seems it has worked so far, I wonder if epicsShareFunc' is necessary here
or even intended. I looked at some EPICS base header and cpp files and found
'epicsShareFunc' is not used for C++ class methods.
So, can I just remove 'epicsShareFunc' qualifiers on class methods?
At least on my win32-x86 VM this worked fine (build & tests).
Cheers
Ben
________________________________
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Dr. Ulrich Breuer
Sitz Berlin, AG Charlottenburg, 89 HRB 5583
Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin
http://www.helmholtz-berlin.de <http://www.helmholtz-berlin.de/>
- Replies:
- RE: Sequencer build errors on Windows Mark Rivers
- Re: Sequencer build errors on Windows Benjamin Franksen
- References:
- Sequencer build errors on Windows Josh Stein
- Re: Sequencer build errors on Windows Benjamin Franksen
- Navigate by Date:
- Prev:
Re: Sequencer build errors on Windows Benjamin Franksen
- Next:
RE: Sequencer build errors on Windows Mark Rivers
- 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: Sequencer build errors on Windows Benjamin Franksen
- Next:
RE: Sequencer build errors on Windows Mark Rivers
- 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
|