Error Message When Compiling .so File - Recompile With -fPIC

Updated Mar 9, 2018

Issue Details

When I am compiling my .so file, I am receiving a compilation error that ends with, 'recompile with -fPIC'. How can I fix this compilation issue?
 

Solution

In this case, your compiler needs the the compiler flag -fPIC to compile correctly.

The method of adding this flag changes depending on the IDE used, but there should be existing documentation for that software of how to add a compiler flag.

WAS THIS ARTICLE HELPFUL?

Not Helpful