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  2012  2013  2014  <20152016  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  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: seq-2.1.12 and C++
From: Hovanes Egiyan <[email protected]>
To: "[email protected]" <[email protected]>
Date: Mon, 24 Aug 2015 14:26:12 -0400
Hi,

I was trying to call SNLs C-functions equivalents for pvPut, pvGet, pvAssign etc (seq_pvPut ...) from a C++ code using seq-2.1.12, and run into a compile-time problem. I was getting error messages from g++:

/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:102: error: conflicting declaration ‘typedef const struct seqChan seqChan’
/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:102: error: ‘struct seqChan’ has a previous declaration as ‘struct seqChan’
/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:103: error: conflicting declaration ‘typedef const struct seqState seqState’
/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:103: error: ‘struct seqState’ has a previous declaration as ‘struct seqState’
/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:104: error: conflicting declaration ‘typedef const struct seqSS seqSS’
/gluex/controls/epics/R3-14-12-3-RHEL5/support/seq-2.1.12/include/seqCom.h:104: error: ‘struct seqSS’ has a previous declaration as ‘struct seqSS’

The problem seems to be coming from seq-2.1.12/src/seq/seqCom.h header file where there are typedef statements for struct structure before actual definition of the structures. C++ does not seem to like it, and I was able to move forward using one "#ifndef __cplusplus" instruction :

#ifndef __cplusplus
typedef const struct seqChan seqChan;
typedef const struct seqState seqState;
typedef const struct seqSS seqSS;
typedef struct seqProgram seqProgram;
#endif

/* Static information about a channel */
struct seqChan
{
...

That way these typedefs are not be present for a C++ compiler.
I do not know if it breaks anything in the bigger picture, but if it does not, may be it could
be included in the "src/seq/seqCom.h" for the seq module.

Hovanes Egiyan


Replies:
Re: seq-2.1.12 and C++ Benjamin Franksen

Navigate by Date:
Prev: Re: Control room console hardware Jack
Next: Records for slow control info22
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Debian 7/8: graphics card Gofron, Kazimierz
Next: Re: seq-2.1.12 and C++ Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·