Hello, I've been trying to compile the id3v2 utility <http://id3v2.sourceforge.net/> in cygwin. I downloaded, compiled and installed libid3 <http://id3lib.sourceforge.net/> with no issues.
My first attempt to compile id3v2 failed due to errors in the makefile which were fixed by using this patch from gentoo: <http://bugs.gentoo.org/show_bug.cgi?id=131700> I then saw the following errors when I tried to compile: >$ make >c++ -L/usr/local/lib -pedantic -Wall -o id3v2 convert.o list.o id3v2.o genre.o >-g -lz -lid3 >/usr/local/lib/libid3.a(utils.o): In function >`_ZN24_GLOBAL__N__Z8mbstoucsSs9convert_iEPvSs': >/home/drbob/id3v2-0.1.11/id3lib-3.8.3/src/utils.cpp:142: undefined reference >to `_libiconv' >/usr/local/lib/libid3.a(utils.o): In function >`_ZN4dami7convertESs11ID3_TextEncS0_': >/home/drbob/id3v2-0.1.11/id3lib-3.8.3/src/utils.cpp:196: undefined reference >to `_libiconv_open' >/home/drbob/id3v2-0.1.11/id3lib-3.8.3/src/utils.cpp:210: undefined reference >to `_libiconv_close' >/usr/local/lib/libid3.a(io_decorators.o): In function >`_ZN4dami2io16CompressedReaderC1ER10ID3_Readerj': >/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.h:1459: >undefined reference to `_uncompress' >/usr/local/lib/libid3.a(io_decorators.o): In function >`_ZN4dami2io16CompressedReaderC2ER10ID3_Readerj': >/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/basic_string.h:1459: >undefined reference to `_uncompress' >/usr/local/lib/libid3.a(io_decorators.o): In function >`_ZN4dami2io16CompressedWriter5flushEv': >/home/drbob/id3v2-0.1.11/id3lib-3.8.3/src/io_decorators.cpp:271: undefined >reference to `_compress' >collect2: ld returned 1 exit status >make: *** [id3v2] Error 1 This was also a makefile problem. A web search brought up this: <http://gcc.gnu.org/ml/libstdc++/2007-06/msg00008.html> which explained the problem to me. Though zlib and iconv were installed they were not correctly listed in the compile command. "-liconv" and "-lz" need to be _after_ "-lid3" as id3lib uses zlib. Unlike linux, windows PE format executables don't have 'lazy binding' of libraries so linked libraries need to be listed in the correct order in the compile command. Here's a diff of the changes: ----------------------------------------------------------------------- $ diff -Naur ./id3v2-0.1.11.orig/Makefile ./id3v2-0.1.11/Makefile --- ./id3v2-0.1.11.orig/Makefile 2004-05-04 19:33:53.000000000 +0100 +++ ./id3v2-0.1.11/Makefile 2009-09-27 01:12:47.497750000 +0100 @@ -7,7 +7,7 @@ LDFLAGS+= -L${PREFIX}/lib/ id3v2: convert.o list.o id3v2.o genre.o - c++ ${LDFLAGS} -pedantic -Wall -lz -lid3 -g -o $@ $^ + c++ ${LDFLAGS} -pedantic -Wall -o $@ $^ -g -lid3 -lz -liconv create_map: create_map.o c++ -Wall -g -o $@ $^ ----------------------------------------------------------------------- Hope this post helps any other newbies like me attempting to compile this utility on cygwin. I've submitted this to the id3v2 bugtracker but I think the program may have no active developers. regards, -- drbob -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple