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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: registerRecordDeviceDriver.obj unresolved external symbols |
From: | "Johnson, Andrew N. via Tech-talk" <[email protected]> |
To: | "[email protected]" <[email protected]> |
Date: | Thu, 23 May 2019 18:41:55 +0000 |
Hi Patrick, On 5/23/19 9:51 AM, Thomas, Patrick via Tech-talk wrote:
<snip>
Okay, looking at your devADS.cpp file, firstly the epicsExport.h header should only be included after all the other EPICS Base headers you include. For static builds the order doesn't really matter, but it definitely will if you're building or linking to DLLs, so best keep it in the right place — it actually marks the boundary between headers for external libraries, and those for routines that will appear in the same DLL as the objects compiled from this file. Mark Rivers was correct about the need for an extern "C" { ... } wrapper, which must appear around the epicsExportAddress() statements and any other epicsExport* statements you include in a C++ source. That change is sufficient for me to be able to build your example — the routines and data structures themselves don't have to be marked as extern "C". The second error above is there because you still have a registrar entry for devADSRegistrar in the adsSupport.dbd file. HTH, - Andrew -- Complexity comes for free, Simplicity you have to work for. |