문제

What does it mean for a library to be both static and shared? From what I've read, those two are mutually exclusive. People tend to define one as the opposite of the other.

But reading the configure options for LAME, I see this.

  $ ./configure --help
  `configure' configures lame 3.99.5 to adapt to many kinds of systems.
  [...]
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  [...]
도움이 되었습니까?

해결책

What those flags do is build both shared libraries and static libraries, they don't try and make a single library both static and shared.

As you say, they are "mutually exclusive" in a sense--no single file can be both a static and shared library.

On a Linux system enabling both static and shared library compilation would give you both a *.a and a *.so file, the *.so file is used for dynamic (shared) linking, while the *.a file is used for static linking.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top