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: Re: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter
From: "Johnson, Andrew N." <[email protected]>
To: "Engbretson, Mark S." <[email protected]>
Cc: EPICS Tech-Talk <[email protected]>
Date: Mon, 2 Feb 2015 23:42:51 +0000
Hi Mark,

A DLL that only exports a C++ class can only be called by a program that is built using a compatible ABI, which for Microsoft means the compilers must have the same major version number. The Gnu policy on their C++ ABI has long stressed compatibility between versions, in contrast to Microsoft's policies. A class exports mangled versions of its symbol names (name mangling has changed in the past) and the class interfaces have also changed between major versions of Visual Studio, thus the compiler must know how to mangle the names from the header file correctly to find the right methods in the DLL, and must also use the correct class interface (RTTI, vtable entries etc.) to be able to use the class properly.

Several of the libCom APIs are written in C++, so the above rules do matter for some EPICS code. The Channel Access API is completely specified in C though, which makes it immune from such issues since Microsoft's C ABI has not changed for a long time.

Microsoft has been proposing enhancements for the C++ standard to define a portable C++ ABI which should allow interoperability in the future, although this will take some work to implement. Search for Herb Sutter's document number N4028 for details.

- Andrew

-- 
Sent from my iPad

> On Feb 2, 2015, at 2:28 PM, Mark S. Engbretson <[email protected]> wrote:
> 
> DLL's are standalone entities which have resolved all their library
> reverences at build time. The windows EPICS libs are already DLL's. ANYTHING
> with the correct header files can talk to it - Pascal, Fortran, past
> versions or future versions. All you have to do is find out if whatever code
> that your building apps for can understand the DLL and link lib formats.
> Grab a recent version for an APS Jenkin build and see what happens.
> Microsoft is rather compatible with itself.
> 
> https://jenkins.aps.anl.gov/job/epics-base-3.14/
> https://jenkins.aps.anl.gov/job/epics-base-3.15/
> 
> That being said - nothing keeps you from building those apps against a 15
> year version of epics. You just don't get later features such as large
> arrays.  Do you need anything that only exists in current versions?
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of Johnson, Andrew N.
> Sent: Monday, February 02, 2015 2:17 PM
> To: J. Lewis Muir
> Cc: EPICS Tech-Talk
> Subject: Re: epicsRingPointer.h error C2664: 'delete' : cannot convert
> parameter
> 
> Hi Lewis,
> 
> Microsoft's attitude to compatibility for C++ code is that you have to use
> the same major compiler version to be able to link programs with separately
> compiled libraries. C code does not have the same restrictions though, which
> is why we can use gcc to build programs that link with the OS libraries, and
> why Windows' APIs haven't been switched to C++ classes.
> 
> It sounds like you are building the vendor's code, which must be done with
> VC6, but can add your own code to their program. I can suggest a few ways to
> interface that with EPICS code built with a newer compiler: Use a socket or
> COM API to to communicate between the two sides, or make the interface a DLL
> with a C-only API as this should allow you to link with and call code from
> the other compiler. A DLL would give you a closer and faster interface, but
> might be more trouble to get working.
> 
> If all you need is to call the CA library it does provide the C-only API and
> DLL that you need, so in this case you might be able to just copy the ca.dll
> and com.dll files from another machine along with a few header files.
> 
> Hope this helps,
> 
> - Andrew
> 
> --
> Sent from my iPad
> 
>>> On Feb 2, 2015, at 1:21 PM, J. Lewis Muir <[email protected]> wrote:
>>> 
>>> On 1/30/15 5:48 PM, Andrew Johnson wrote:
>>> I don't think you'll be able to, MS Visual C++ 6 was released in 1998
>>> (17 years ago, long before MS implemented standard C++) and it 
>>> doesn't support all of the C++ constructs that we make use of in 
>>> Base. In 2008 Jeff Hill explained that VC7 was too old to build
> Base-3.14.9:
>>>   http://www.aps.anl.gov/epics/tech-talk/2008/msg00078.php
>>> 
>>> Can't you upgrade the compiler?
>> 
>> Hi, Andrew.
>> 
>> Thanks for your reply.  I'm writing a library (that uses EPICS CA) 
>> that I need to work with a vendor-supplied program.  Unfortunately, 
>> I've been told by the vendor that the program will only build with 
>> VC6, hence, in order to have the best chance of things working right, 
>> I was planning to use the same compiler to build my library (and EPICS
> Base).
>> 
>> So, to answer your question, upgrading the compiler is perhaps 
>> possible, but I fear it might result in significant pain.
>> 
>> I'm not a Windows expert.  Is it possible to install, say, Visual 
>> Studio
>> 2010 *alongside* VC6 on Windows 7?  And if so, is it possible to 
>> compile EPICS Base and my library as DLLs that the VC6 vendor-supplied 
>> program can link against?
>> 
>> Thank you!
>> 
>> Lewis
> 


Replies:
RE: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter Mark S. Engbretson
References:
epicsRingPointer.h error C2664: 'delete' : cannot convert parameter J. Lewis Muir
Re: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter Andrew Johnson
Re: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter J. Lewis Muir
Re: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter Johnson, Andrew N.
RE: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter Mark S. Engbretson

Navigate by Date:
Prev: RE: Read record field in asynDriver Mark Rivers
Next: Strawberry Perl Make still broken? J. Lewis Muir
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: Re: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter J. Lewis Muir
Next: RE: epicsRingPointer.h error C2664: 'delete' : cannot convert parameter Mark S. Engbretson
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 ·