For Mac, the library extension name can be anything?
I'm testing SWIG on Mac.
The default file extension that SWIG on Mac produces is .so file as follows.
g++ -arch i386 -bundle -undefined suppress -flat_namespace
exam开发者_高级运维ple.o example_wrap.o -o libexample.so
However, I have no problem with -o libexample.dylib in terms of making and running the result.
Why is this? For Mac, the library extension name can be anything?
What matters is the internal Mach-O object file type rather than the file name or extension. See, for instance, the explanation here.
精彩评论