Symbol lookup error while loading .so file in .Net Core application
Symbol lookup error
I am loading a.so file in my .Net Core 3.1 console application using DllImport.
My a.so file depends on b.so, c.so and d.so.
Also b.so depends on e.so.
While running my application on Linux machine (Red Hat 7.0), it gives me error like following:
dotnet : symbol lookup error /root/Path of My Application/a.so : undefined symbol : my_symbol_name
Note:
my_symbol_name is defined in b.so which is called from a.so.
I am using Visual Studio 2019 version16.7.1 for development. OS : Windows Server 2012 R2 Application running platform : Linux (Red Hat 7.0) .Net Core Version 3.1.401
As a random bystander, I am curious as to what is causing this. What does ldd /root/Path of My Application/a.so say? Can it see and resolve the dependencies on b.so, c.so and d.so?
@mikem8361 @janvorli is this something you can help with?
This isn't exactly my area, but it looks like you are doing a pinvoke (DllImport) I assume. Is the function you are pinvoking to "my_symbol_name". Is that symbol an "extern C" public symbol?
Issue is resolved. Thanks to everyone for putting your valuable efforts.
Issue was resolved by bundling all .so files in single package(linking them together). I think it was not on .Net Core side.
Thanks for letting us know. Closing the issue.