Hi,
I've been trying for some time now to use id3lib with dev
c++. I think the first major problems lies with
configuring the ide correctly. So firstly to try and help
some of you out with the dev c++ setup, this is what I
have done:
1. Extracted the header files to my project directory.
2. Extracted the windows binary files (.lib, .dll, .exp) to
the project directory
3. Renamed config.h.win32 to config.h and copied it to
my project directory
4. In the Project > Project Options dialog:
[Parameters Tab]
Added the "-lid3lib" and "-lz" (without quotes) to the
linker box (zlib) is included with devc++
[Directories -> Library Directories tab]
Added the path to the windows binary files (id3lib.lib
etc.)
[Directories -> Include Directories tab]
Added the path to the header includes
(<project_path>\include & <project_path>\include\id3)
5. wrote a simple app. If you read the id3lib installation
instructions (which apply to MS VC++) they say you
must use the /D parameter to define certain options (like
static linking). I'm quite new to gcc/g++ and I couldn't
find similar parameter by looking at the help (g++ --help)
so I just put the definition in my source. Here's my code:
#define ID3LIB_LINKOPTION 1
#include "id3/tag.h"
int main() {
ID3_Tag myTag("song.mp3");
return 0;
}
If I try to compile this I get undefined reference errors.
Here is a dump of dev c++ compile log:
Compiler: Default compiler
Building Makefile: "C:\Software\Dev-
Cpp\myprograms\id3lib_test\Makefile.win"
Executing make...
make.exe -f "C:\Software\Dev-
Cpp\myprograms\id3lib_test\Makefile.win" all
g++.exe main.o -o "id3lib_test.exe" -L"C:/Software/Dev-
Cpp/lib" -L"C:/Software/Dev-
Cpp/myprograms/id3lib_test" -lid3lib -lz
main.o(.text+0x575):main.cpp: undefined reference to
`ID3_Tag::ID3_Tag(char const*)'
main.o(.text+0x587):main.cpp: undefined reference to
`ID3_Tag::~ID3_Tag()'
make.exe: *** [id3lib_test.exe] Error 1
Execution terminated
I may be HORRIBLY off track here, but this is as far as I
have managed to get using dev c++. I have not tried it
under VC++, purely because I don't have it. My aim is
to bring out a DevPak as soon as I get my head around
all this. If anyone has ANY ideas please post them.
Thanks,
Wayne
Logged In: YES
user_id=1476148
Originator: NO
I have got it to work fine with my DevCpp
First thing I did was to import the msvc project from the "libprj" folder. I changed "config.h.win32" as you said and I made sure that all the links in the new project options were all right. I added "-lz" so that it doesn't recompile the zlib as well and I compiled the entire project as a statis library.
I've added the resulting "id3lib.a" to the "lib" folder in the "DevCpp" dir and afterwards compiling any program as you said worked fine.
I'm not sure of what you did, but you will definitely need to compile the library with DevCpp before using it for static linking.
Good luck, I'm looking forward for that Dev-pack!!
Cat