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: | "Liyu, Andrei V" <[email protected]> |
To: | "Jeff Hill" <[email protected]>, <[email protected]> |
Date: | Thu, 21 May 2009 16:01:28 -0700 |
Jeff hi, Compiler is not a issue because header file doesn’t have
ca_detach_context() function. I again have loaded baseR3.14.10.tar.gz file (date is October 27,
2008) from Epics cite In ...\src\ca\cadeh.h From line 115 (you mentioned about line 119) ========== typedef struct
event_handler_args { void
*usr; /* user argument supplied with request
*/
chanId chid; /* channel id */ long
type; /* the type of the item returned */
long
count; /* the element count of the item
returned */ READONLY void
*dbr; /* a pointer to the item returned */ int
status; /* ECA_XXX status of the requested op from
the server */ }
evargs; ====== From line 874 ======== /* * used when an auxillary thread
needs to join a CA client context started * by another thread */ epicsShareFunc struct
ca_client_context * epicsShareAPI ca_current_context (); epicsShareFunc int
epicsShareAPI ca_attach_context ( struct
ca_client_context * context ); epicsShareFunc int
epicsShareAPI ca_client_status ( unsigned level
); epicsShareFunc
int epicsShareAPI ca_context_status ( struct ca_client_context *, unsigned
level ); ======= I don’t see line with epicsShareFunc void epicsShareAPI
ca_detach_context (); Maybe somebody load baseR3.14.10.tar.gz (date is October 27,
2008) and check also. Thanks, Andrei. From: Jeff Hill
[mailto:[email protected]] 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. |