Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: -fPIC ignored for target (all code is position independent)

I'm creating a shared (.DLL) library and I keep getting this message from the compiler (gcc):

json.c:1:0: warning: -fPIC ignored for target (all code is position independent)

What does it mean that all code is position independent?

How a position dependent code looks like?

like image 297
Martin Majer Avatar asked Nov 12 '13 20:11

Martin Majer


1 Answers

What does it mean that all code is position independent?

It means that on your platform, all code is compiled as if -fPIC is on command line, whether you specify it or not (and the flag is therefore redundant).

You can safely ignore that warning.

like image 165
Employed Russian Avatar answered Oct 25 '22 15:10

Employed Russian