delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/26/21:40:22

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: drbob <drbob AT gmx DOT co DOT uk>
Subject: Compiling id3v2
Date: Sun, 27 Sep 2009 02:35:16 +0100
Lines: 67
Message-ID: <u9gtb5djf8bhiv2f2dkbheh2id1cp3p8ab@4ax.com>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019