Visionworks 1.6 Samples nvxio linking to shared library

Hello,

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?

Hi,

Do you run ROS on Jetson platform?

Here is a relevant topic may help:
[url]https://devtalk.nvidia.com/default/topic/1016273/jetson-tx2/visionworks-linking-problem/post/5179211/#5179211[/url]

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.

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