I ran into an unexpected issue with regards to importing dynamic libraries and was hoping to get some clarification about what the expected behavior ought to be and what I might be able to do to fix the issue. Take the following
foreign import external_lib {"mylib.so"}
foreign external_lib {
// methods ...
}
Let’s say that mylib.so
happens to be globally available as well. However I’d like to recompile mylib as there are some things I don’t need at the moment, so assume that I have a local copy inside my project.
I saw this line in the news doc about this
foreign import foo "foo.so" // shared lib in linux links to /path/to/executable/foo.so
However, when I try to compile my Odin app, it always seems to default to the global version and does not appear to use my local copy until I break the path to the global version.
Is there a better way of making Odin use the local copy of the library instead of the global one? I did see this behavior when compiling a C program using Cmake as well so I assume there’s some flag or other option I’m not using.
Apologies if this is described somewhere, I can’t seem to find any other references other than that news doc.
Thank you!