If I compile dynamic C/C++ Linux 64-bit libraries for FreeBASIC I must use "-fPIC" !
Why does it works without fbc "-pic" if I compile dynamic fbsound libraries for Linux 64-bit ?
Joshy
[solved] Why -dylib works without "-pic" Linux 64-bit ?
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
[solved] Why -dylib works without "-pic" Linux 64-bit ?
Last edited by D.J.Peters on May 10, 2021 21:11, edited 1 time in total.
Re: Why -dylib works without "-pic" Linux 64-bit ?
fbc automatically adds '-fPIC' if you are compiling a shared/dynamic library. Compiler Option: -pic
But you will need to add '-pic' if compiling '-c' only to an object file and then later linking to dynamic library. i.e. if compiling and linking are done in two different steps.
But you will need to add '-pic' if compiling '-c' only to an object file and then later linking to dynamic library. i.e. if compiling and linking are done in two different steps.