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: where is ca_detach_context()? |
From: | "Jeff Hill" <[email protected]> |
To: | "'Liyu, Andrei V'" <[email protected]>, <[email protected]> |
Date: | Thu, 21 May 2009 15:31:31 -0600 |
Hi Andrei, You
should see the function prototype, as follows, at about line number 189 in
cadef.h. “epicsShareFunc
void epicsShareAPI ca_detach_context ();” I
see it also at ordinal 119 with symbol name “_ca_detach_context@0”
when I run the ms depends.exe tool, and load ca.dll. I
am looking at the very latest version of R3.14, but I don’t expect that
any of this has changed in the patch releases. > I can’t use ca_detach_context ()
in my program because > compiler
doesn’t find this function. Are you
using the MS compiler? Perhaps you need to specify /MD to enable linking with multithreaded
DLL runtime libraries. Typical
Windows MS Build Options cl -c /nologo /D__STDC__=0
/Ox /GL /W3 /w44355 /MD -I. -I.. -I..\\..\\..\\include\\os\\WIN32
-I..\\..\\..\\include ..\\acctst.c link -nologo /LTCG
/incremental:no /opt:ref /release /version:3.14 -out:acctst.exe acctstMain.obj
acctst.obj d:/user/R3.14.clean/epics/base/lib/WIN32-x86/ca.lib
d:/user/R3.14.clean/epics/base/lib/WIN32-x86 In summary, the following code
runs in the preprocess in shareLib.h when it’s a windows compilation. As
I recall, _DLL is defined by windows compilers when /MD (or the equivalent with
a 3rd party compiler) is specified. #
if defined(_DLL) /* this indicates that we are being compiled to call DLLs */ #
define epicsShareExtern __declspec(dllimport) extern #
define epicsShareClass __declspec(dllimport) #
define epicsShareFunc __declspec(dllimport) #
else #
define epicsShareExtern extern #
define epicsShareClass #
define epicsShareFunc #
endif Jeff From:
[email protected] [mailto:[email protected]] On
Behalf Of Liyu, Andrei V Hi, I need to write simple CA
client with couple threads. Both threads use CA. So I need to use
ca_attach_context() and ca_detach_context() in second thread. … I can’t use ca_detach_context ()
in my program because compiler doesn’t find this function. I checked manually and couldn’t find “ca_detach_context” in cadef.h and ca.dll files. I do found “ca_detach_context”
in access.cpp and CAref.html have it. What is wrong? I try to use Epics versions 3.14.9 and 3.14.10. Thanks, Andrei. |