Find Taglib library - installation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Find Taglib library - installation

Christophe Ribal

Hello,

I'm contacting you because I can't find any clear information about how to properly install and run Taglib. I've installed it using cmake commands (... -> sudo make install ) but now I'm stuck. I can include the headers from my IDE, but I have some linking errors as it seems that the compiler can't find the compiled library (undefined reference to TagLib:: ...)

I've read the following sentence :

Note that TagLib's include install directory must be included in the header include path. Simply adding <taglib/tag.h> will not work.

But I can't figure out how to do that and whether it's a path to the solution or not.


Thanks in advance for any help,

--

Christophe Ribal
Reply | Threaded
Open this post in threaded view
|

Re: Find Taglib library - installation

Fred Gleason-2
On Tue, 2019-04-02 at 15:58 +0000, Christophe Ribal wrote:

> I'm contacting you because I can't find any clear information about
> how to properly install and run Taglib. I've installed it using cmake
> commands (... -> sudo make install ) but now I'm stuck. I can include
> the headers from my IDE, but I have some linking errors as it seems
> that the compiler can't find the compiled library (undefined
> reference to TagLib:: ...)
> I've read the following sentence :
> > Note that TagLib's include install directory must be included in
> > the header include path. Simply adding <taglib/tag.h> will not
> > work.
>
> But I can't figure out how to do that and whether it's a path to the
> solution or not.

Generally, the easiest way is to use pkg-config(1) to determine the
necessary flags. Thus, the output of:

        pkg-config --cflags taglib

should be added to $CPPFLAGS in your Makefile(s). Likewise, the output
of:

        pkg-config --libs taglib

should be added to $LIBS

If you're using Autoconf/Automake, one easy way to do this is to use
the PKG_CHECK_MODULES() macro. For example, put:

PKG_CHECK_MODULES(TAGLIB,taglib,[],[AC_MSG_ERROR([*** TagLib not found
***])])

in your 'configure.ac', then add '@TAGLIB_CFLAGS@' and '@TAGLIB_LIBS@'
to 'AM_CPPFLAGS' and '<target-name>_LDADD' respectively in your
'Makefile.am'(s).

Cheers!


|---------------------------------------------------------------------|
| Frederick F. Gleason, Jr. |             Chief Developer             |
|                           |             Paravel Systems             |
|---------------------------------------------------------------------|
|         A room without books is like a body without a soul.         |
|                                                                     |
|                                                         -- Cicero   |
|---------------------------------------------------------------------|

Reply | Threaded
Open this post in threaded view
|

Re: Find Taglib library - installation

Christophe Ribal
Hi again,
thanks, you solved my problem!

Le 02/04/2019 à 20:10, Fred Gleason a écrit :

> Generally, the easiest way is to use pkg-config(1) to determine the
> necessary flags. Thus, the output of:
>
> pkg-config --cflags taglib
>
> should be added to $CPPFLAGS in your Makefile(s). Likewise, the output
> of:
>
> pkg-config --libs taglib
>
> should be added to $LIBS

This was what was missing, I tried to link taglib with -libtag but I
didn't know the library exact name to add it on my CMakeLists. -ltag was
the right one !

Works perfectly then, currently trying to get how to edit id3v2 tags for
vorbis but at least I got basic tag editing.

Cheers !

--

Christophe