0

If I want to create a static library for everyone to use, is it necessary compile it with -fPIC or -fPIE?

It is working for me without -fPIC or -fPIE.

Samuel
  • 731
  • 5
  • 15

1 Answers1

2

You want your library to be linkable into shared libraries, position-dependent and position-independent executables. The only flag which works in all of these cases is -fPIC so that's the one you should use.

yugr
  • 16,844
  • 3
  • 43
  • 82