I downloaded id3lib and placed the directory in my main.cpp directory but both g++ and visual studio give file/directory not founds and "undefined" errors
Here is my main.cpp:
#include <iostream>
#include <id3lib-3.8.3/include/id3/tag.h>
int main() { std::cout << "hi"; }
g++ main.cpp gives:
main.cpp:2:46: fatal error: id3lib-3.8.3/include/id3/tag.h: No such file or
directory
#include <id3lib-3.8.3/include/id3/tag.h>
if I use "" instead of <>, i get this error:
id3lib-3.8.3/include/id3/tag.h:32:30: fatal error: id3/id3lib_frame.h: No
such file or directory
#include <id3/id3lib_frame.h>
It's not enough to put it beside your main file. As you can see in your first approach when you used
#includewith<>it can't find it, that's because (copied from here) :You didn't tell your compiler where to look for
id3lib-3.8.3/include/id3/tag.hso<>will not work for you.Then you tried
"". it foundid3lib-3.8.3/include/id3/tag.hbut in thetag.hthere is#include <id3/id3lib_frame.h>, So back to problem with first approach, right?What you need to do is that you need to tell your compiler/IDE where to look for these files. In visual studio click right on your project file, then properties->C/C++->General->Additional Include Directories and add the include library (
$(ProjectDir)id3lib-3.8.3/include/or maybe$(SolutionDir)id3lib-3.8.3/include/) to it. Then your first approach should work fine.