Text / log confirmation that library in app is build as static vs dynamic

We are trying to compare static vs dynamic of our library.

I understand we can set type to .static or .dynamic.

But in the app that is using the library, I could not find the difference. How I can find confirmation that I am building the library as .static vs .dynamic?

what I did:
reset package cache, update package etc. Confirm .static Vs .dynamic is updated according in the package.swift in the using project.

How to:
Get a visual confirmation in log or build setting that I am in deed building static vs dynamic?

If you use object file examination tools like otool, nm, and their equivalents in Linux and Windows, on the executable, you should be able to identify the dynamic libraries the executable will load during runtime setup. If you find your library in that list, it is a dynamic library. If not, it was statically linked into the executable during linking.

1 Like

thanks. I am on Mac.
zero experience with otool and nm but I am starting to google :slight_smile:

@jonprescott I used ottol -L executable and confirmed I see it in the list when I set it to .dynamic and gone when I set it to .static.
works like a charm.

Terms of Service

Privacy Policy

Cookie Policy