Compile fails, says "recompile with -fPIC"

I am now back to compiling the git snapshot.

“./waf configure” appears to succeed. “./waf -v” fails with the error output ending with the pasted below. (After that it just lists *.o objects that I presume it has compiled). I see the recommendation to compile (configure?) with “-fPIC” but I have no idea where to add that switch, in practice.

canvas/tracking_text.cc.1.o’]
/usr/bin/ld: /usr/local/lib/libtag.a(unknownframe.cpp.o): warning: relocation against _ZTVN6TagLib5ID3v212UnknownFrameE' in read-only section .text’
/usr/bin/ld: /usr/local/lib/libtag.a(oggfile.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN6TagLib3Ogg4FileE’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

------------ end quote -------------------

EDIT: Forgot to say I am on Ubuntu 22.04.1 LTS

This is the configure command which I have been using, which seems to work on all recent versions of gcc:

./waf configure --libjack=weak --with-backends=jack,alsa,dummy --cxx11 --strict --optimize

If you want the debug build don’t include “–optimize”
If you don’t need all three backends feel free to remove one or more of those, or add pulseaudio if you need that backend.

The problem with with your local built of http://taglib.github.io (not ardour itself).

Perhaps prefer a properly built distro provided shared library, rather than a local static lib.

Thanks for replying, Chris.

Followed your instruction. Configured with exactly your line:

" /waf configure --libjack=weak --with-backends=jack,alsa,dummy --cxx11 --strict --optimize "

Appears to be exact same result. (And I actually may have used the exact same configure options the previous time.)

last lines from the ./waf error with your config options:

[ 491/1203] Compiling libs/gtkmm2ext/application.cc
[ 492/1203] Compiling libs/gtkmm2ext/cairo_packer.cc
/usr/bin/ld: /usr/local/lib/libtag.a(unknownframe.cpp.o): warning: relocation against _ZTVN6TagLib5ID3v212UnknownFrameE' in read-only section .text’
/usr/bin/ld: /usr/local/lib/libtag.a(oggfile.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN6TagLib3Ogg4FileE’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

My gcc version is:

gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0

PS. Just saw reply by Gareus regarding taglib. Will reply to his.

in that case apt install libtag1-dev (and remove your custom version from /usr/local/.

On my Ubuntu 22.04.1 LTS

sudo apt install libtaglib[TAB TAB TAB] … :

libtaglib2.1-cil
libtaglib-ocaml
libtaglibs-standard-impl-java
libtaglibs-standard-spec-java
libtaglib-cil-dev
libtaglib-ocaml-dev
libtaglibs-standard-jstlel-java

There doesn’t appear to be a “libtaglib-dev”. This is why I locally built taglib-1.12

please advise.

That was evidence of a crappy readout of “gcc --version”. That readout includes Ubuntu followed by gcc version.

Like I said in the other posts, I am on Ubuntu 22.04.1 LTS

Never mind! I do have libtaglib1-dev !! And it’s installed !

I guess apt now filters out the installed packages when auto prompting !

(duh!)

Will now try to remove the local build. Thanks.

Ardour built!! And opened (only with qjackctrl so far)

Thank you, Chris and Robin Gareus !

My final issue was a local build of libtaglib . I removed the local build and used the distrib version “libtag1-dev”. Hooray.