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
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.