Stupid, stupid C newb question

Jeremy Gregorio jeremy.firefox.addon at
Thu Nov 8 03:54:40 UTC 2012

Forgive me for asking this, but I'm banging my head against the wall
because IDEs have spoiled me,

I want to do hello world in taglib. I've done it before years ago, but
can't remember how.

I built taglib staticly in Linux using:

make install

It worked like a charm and I now have

and the whole
/usr/local/include/taglib/ folder with the headers

Here's my little cpp

// my first program in C++

#include <iostream>
using namespace std;
#include "tag.h";
#include "fileref.h";

int main ()

 TagLib::FileRef f("Latex Solar Beef.mp3");
 TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa"

 f.tag()->setAlbum("Fillmore East");;

 TagLib::FileRef g("Free City Rhymes.ogg");
 TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers"


  return 0;

And I try to build with:

g++ -o hello2 hello.cpp -I/usr/local/include/taglib/  -L/usr/local/lib/

But I get back:

hello.cpp:5:17: warning: extra tokens at end of #include directive [enabled
by default]
hello.cpp:6:21: warning: extra tokens at end of #include directive [enabled
by default]
/usr/bin/ld: cannot find -llibtag
collect2: ld returned 1 exit status

I know I'm just doing something dumb, but for the life of my I can't
remember what. :P

Jeremy D Gregorio
Sr Consultant
#: 520-275-5352
fax: 520-747-2540

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the taglib-devel mailing list