Visionworks 1.6 Samples nvxio linking to shared library


I’m writing a ROS nodelet (shared library) which needs to use libovx\libnvx static libraries.

At linking stage I get:
libovx.a(UtilityOVX.o): relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC

Is the only way to get rid of the problem is to recompile Visionworks 1.6 Samples with -fPIC?


Do you run ROS on Jetson platform?

Here is a relevant topic may help:

No, I run on PC with Ubuntu 16.04.
I link with the libovx, libnvx.
The problem is that I link them to my shared library,
and they are built without -fPIC.

I solved by rebuilding ovx\nvx with -fPIC.

What I want to know is this the only way.

Please compile your source with -fPIC, or it will not be relocatable.