Stupid, stupid C newb question
Jeremy Gregorio
jeremy.firefox.addon at gmail.com
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:
cmake -DENABLE_STATIC=ON -DCMAKE_INSTALL_PREFIX=/usr/local
-DCMAKE_RELEASE_TYPE=Release .
make
make install
It worked like a charm and I now have
/usr/local/lib/libtag.a
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");
f.save();
TagLib::FileRef g("Free City Rhymes.ogg");
TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers"
g.tag()->setTrack(1);
g.save();
return 0;
}//END MAIN
And I try to build with:
g++ -o hello2 hello.cpp -I/usr/local/include/taglib/ -L/usr/local/lib/
-llibtag
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
<http://www.linkedin.com/pub/jeremy-gregorio/36/302/429>
<http://www.glimmersoft.com/socialmedia/btn_viewmy_160x33.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20121107/f103982e/attachment.html>
More information about the taglib-devel
mailing list