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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Problems compiling Nexus library as DLL on Windows |
From: | Andrew Johnson <[email protected]> |
To: | Mark Rivers <[email protected]> |
Cc: | Jan Ilavsky <[email protected]>, "'Mark Koennecke'" <[email protected]>, "Schwarz, Nicholas" <[email protected]>, "Madden, Timothy J." <[email protected]>, "'Glowacki, Arthur T.'" <[email protected]>, "[email protected]" <[email protected]> |
Date: | Fri, 23 Aug 2013 08:50:49 -0500 |
Hi Mark, On 08/22/2013 10:21 PM, Mark Rivers wrote:
The problem is that when H5Tpublic.h is being included the macro H5_DLLVAR is not correctly defined to be "__declspec(dllimport)". Rather H5_DLLVAR appears to be defined as "extern". This causes the linker to be unable to locate these symbols, even though they are correctly exported by the .lib file. I just need to figure out why H5_DLLVAR is not being correctly defined in H5api_adpt.h. It looks like it should be, but clearly I am doing something wrong.
Decorators like that are a common issue with Windows builds, EPICS has the epicsShare* macros defined in shareLib.h which on Windows expand to __declspec(dllimport) when calling the relevant symbol from a DLL, __declspec(dllexport) when building the DLL, or to nothing when building or calling a static library.
You may have to add a command-line argument to the compiler to define some symbol that tells the header whether the Nexus library is being built as a DLL, or being called in one. Look in the header that defines H5_DLLVAR and compare what it's doing with what shareLib.h does.
HTH, - Andrew -- Advertising may be described as the science of arresting the human intelligence long enough to get money from it. -- Stephen Leacock