<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 01/07/2016 04:50 PM, Abhishek Singh
wrote:<br>
</div>
<blockquote
cite="mid:CAK=ENCDDFL0dKRYgX0ohwb6hnEe-eVzTyVnEQuwEGznLU5hYhg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">
<div>I was able to overcome this error by copying macro
statements from below link:</div>
<div><br>
</div>
<a moz-do-not-send="true"
href="https://github.com/couchbase/couchdb/blob/master/src/couchdb/priv/couch_ejson_compare/couch_ejson_compare.c#L486-L493">https://github.com/couchbase/couchdb/blob/master/src/couchdb/priv/couch_ejson_compare/couch_ejson_compare.c#L486-L493</a><br>
<div><br>
</div>
</div>
</blockquote>
#ifndef _MSC_VER<br>
#if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)<br>
__global<br>
#elif defined __GNUC__<br>
__attribute__ ((visibility("default")))<br>
#endif<br>
<br>
#endif<br>
ERL_NIF_INIT(...)<br>
<br>
<blockquote
cite="mid:CAK=ENCDDFL0dKRYgX0ohwb6hnEe-eVzTyVnEQuwEGznLU5hYhg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Not sure what exactly it does, would be useful if somebody
could throw some light on it.</div>
</div>
<br>
</blockquote>
<br>
<br>
My guess is the .so file is linked with option -fvisibility=hidden<br>
which according to the gcc man page "...can very substantially
improve<br>
linking and load times of shared object libraries, produce more
optimized code,<br>
provide near-perfect API export and prevent symbol clashes".<br>
<br>
That is, all symbols are made hidden by default and the above macro
cludge<br>
makes an exception for the "nif_init" function that needs to be
visible.<br>
<br>
I will see if I can incorporate that into the ERL_NIF_INIT macro.<br>
<br>
<br>
/Sverker, Erlang/OTP<br>
<br>
<br>
</body>
</html>