<div dir="ltr">For everyones amusement and information. I have overlooked something important as a noob and then some. <div>Compiling and linking where done in two steps, and i have reused makefile form another project not realizing that </div><div>linking step would be done by "cc" and that was the problem, changing it to for example g++ resolved my issue. </div><div><br></div><div>This was one of those costly errors, when one stares at build output for very long time and not seeing things that are </div><div>plainly there.  </div><div><br></div><div>thank you everyone for help</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 5, 2017 at 11:11 AM, Mikael Pettersson <span dir="ltr"><<a href="mailto:mikpelinux@gmail.com" target="_blank">mikpelinux@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Karlo Kuna writes:<br>
 > also<br>
 > ldd -r my.so<br>
 > gives:<br>
 > undefined symbol: _ZNSt8ios_base4InitD1Ev<br>
 > undefined symbol: enif_make_atom<br>
 > undefined symbol: _ZNSt8ios_base4InitC1Ev<br>
<br>
</span>The enif_make_atom one is expected; it will be satisfied by the VM itself<br>
when you load the .so.<br>
<br>
The others indicate that the dynamic linker is unable to find all external<br>
shared libraries you depend on, in particular ones that should have come<br>
from the system's C++ / libstdc++ installation.<br>
<br>
Something's fishy with your system or your build/deploy procedures.<br>
<span class=""><br>
 ><br>
 ><br>
 ><br>
 > On Sun, Feb 5, 2017 at 6:48 AM, Karlo Kuna <<a href="mailto:kuna.prime@gmail.com">kuna.prime@gmail.com</a>> wrote:<br>
 ><br>
 > > now i'm getting:<br>
 > > undefined symbol: _ZNSt8ios_base4InitD1Ev<br>
 > ><br>
 > ><br>
 > ><br>
 > > On Sat, Feb 4, 2017 at 11:45 PM, Stanislaw Klekot <<a href="mailto:erlang.org@jarowit.net">erlang.org@jarowit.net</a>><br>
 > > wrote:<br>
 > ><br>
 > >> On Sat, Feb 04, 2017 at 11:25:33PM +0100, Karlo Kuna wrote:<br>
 > >> > i am using c++ to implement nif module<br>
 > >> > and i am using nifpp (<a href="https://github.com/goertzenator/nifpp" rel="noreferrer" target="_blank">https://github.com/<wbr>goertzenator/nifpp</a>)<br>
 > >> ><br>
 > >> > now i can compile my project but on function call i get:<br>
 > >> ><br>
 > >> > Failed to load NIF library: my.so undefined symbol:<br>
 > >> > _ZTVN10__cxxabiv117__class_<wbr>type_infoE<br>
 > >> ><br>
 > >> > can someone give me a hint what is this error?  is it linkage, or bad<br>
 > >> call,<br>
 > >> > or something else<br>
 > >> > and how go about solving it?<br>
 > >><br>
 > >> It's because of name mangling by C++ compiler (necessary thing for<br>
 > >> overloaded functions to work). It's a totally expected problem when<br>
 > >> you're writing in C++ a library that needs to be used by system written<br>
 > >> in C. You need to disable name mangling for your NIF function.<br>
 > >><br>
 > >> --<br>
 > >> Stanislaw Klekot<br>
 > >><br>
 > ><br>
 > ><br>
 ><br>
</span> > ------------------------------<wbr>------------------------------<wbr>----------<br>
<span class=""> > ______________________________<wbr>_________________<br>
 > erlang-questions mailing list<br>
 > <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
 > <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br>
</span>--<br>
</blockquote></div><br></div>