Compiling issue ubuntu 14.04 + ARToolkit issue

Hi folks!

I need to build a project with ARToolkit, and as far as I couln’t find a package to Ubuntu 14.04, I decided to compile it. But previously I manage to install the ARToolkit, which is working fine, and the Fmodex, to prepare my computer to Panda3D.
I hardly do this compiling process so, I am not sure how to solve issues.

I also read this previous post: Compiling panda3d-1.9 in Ubuntu 14.04 LTS (trusty) 64bit
And this blog post: ubuntuusertips.wordpress.com/201 … ntu-14-04/

And it seems there’s a problem with the ARToolkit. Below is the error while compiling. If someone could point me a solution, :slight_smile: thanks a lot!

paulo@micro234:~/Panda3D/panda3d$ makepanda/makepanda.py --everything --no-fftw --installer
WARNING: Could not locate thirdparty package fcollada, excluding from build
WARNING: Could not locate thirdparty package swresample, excluding from build
WARNING: Could not locate thirdparty package fmodex, excluding from build
WARNING: Could not locate thirdparty package opencv, excluding from build
WARNING: Could not locate thirdparty package squish, excluding from build
WARNING: Could not locate thirdparty package tiff, excluding from build
WARNING: Could not locate thirdparty package vrpn, excluding from build
WARNING: Could not locate thirdparty package rocket, excluding from build
Generating dependencies...
[ 34%] Linking dynamic library built/lib/libp3vision.so
/usr/bin/ld: //usr/local/lib/libAR.a(paramFile.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
//usr/local/lib/libAR.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Storing dependency cache.
Elapsed Time: 1 sec
The following command returned a non-zero value: g++ -shared -Wl,-soname=libp3vision.so.1.9 -o built/lib/libp3vision.so.1.9 -Lbuilt/lib -Lbuilt/tmp built/tmp/p3vision_composite1.o built/lib/libpanda.so built/lib/libpandaexpress.so built/lib/libp3dtool.so built/lib/libp3dtoolconfig.so -pthread -L/usr/X11R6/lib -lAR -ljpeg -ldl
Build terminated.

The problem is that when you’re linking a static library (libAR.a) into a dynamic library (libp3vision.so), the static library needs to be compiled to only use position-independent code.

So, either recompile ARToolKit as a shared library (as libAR.so) or keep it a static library but recompile it with the -fPIC flag.