http://www.perlmonks.org?node_id=989165


in reply to Audio::TagLib and Strawberry Perl

Yipee! It compiles to completion ... though broken to get there . :(

Hopefully I have done the foot work and narrowed it down for a C++ guru to be able to resolve this in minutes! (or less)
The issue revolves around iostream (I think they are the overloaded iostream operators)??

Short Version.
With the following changes one can get Audio::TagLib to compile and install ... However it will not return data.

After Taglib is installed, edit the following three files.

tbytevector.h tstringlist.h tstring.h
Commenting out the
#include <iostream>

Then editing Audio::TagLib/TagLib.xs and adding the following two lines just after #include "ppport.h"

#undef PerlLIO_read #undef PerlLIO_write

And last but not least modifying Makefile.pl ... I'll just give mine as an example, It's hacked it so please don't chew me up to small! (Included at end)

Long version and Installation details. (It's quick and easy)
Installing Audio::TagLib on Windows XP SP3 with Strawberry Perl v5.16.1.1.
I'll assume Strawberry Perl (or your Win32 Perl Pref) and CMake is already installed.

Taglib-1.7.2 can be found here: https://github.com/downloads/taglib/taglib/taglib-1.7.2.tar.gz
And Audio::TagLib here: http://search.cpan.org/CPAN/authors/id/G/GL/GLEACH/Audio-TagLib-1.61.tar.gz

Change directory to where you expanded Taglib. (C:\Libraries\Taglib-1.7.2)
Run:

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:/Libraries/TagLib +-DCMAKE_RELEASE_TYPE=Release . gmake gmake install

Taglib is now installed!
Following my examples Taglib will be installed to: C:\Libraries\Taglib

At this time Audio::Taglib will not compile do to issues with iostream and the overloaded operators (I think thats what they are), I am NO C++ guru, I do not understand them, Hopefully I have done the foot work for a C++ guru to be able to resolve this in minutes! (or less)

So to get it to compile you need to edit the following three Taglib header files (C:\Libraries\Taglib\Include\Taglib\):

tbytevector.h tstringlist.h tstring.h

Comment out the: #include <iostream>

Expand Audio::TagLib to: C:\Strawberry\cpan\build\Audio-TagLib-1.61
CD to: C:\Strawberry\cpan\build\Audio-TagLib-1.61
Edit Makefile.pl
All the "taglib-config" stuff has got to go ... Replicate with hard coded values.
See my Makefile.pl included at the end.
Edit TagLib.xs
Add the following two lines right after #include "ppport.h"

#undef PerlLIO_read #undef PerlLIO_write
Run:
perl Makefile.pl dmake dmake install

My Makefile.pl

use 5.008001; use ExtUtils::MakeMaker; use Config; my $libdir = 'C:/Libraries/taglib/lib'; my $includedir = 'C:/Libraries/taglib/include'; my $libver = '1.7.2'; my $CC = 'g++'; my $libs = ' -L' . $libdir . ' -llibtag.dll'; #my $cflags = '$Config{'ccflags'}; my $cflags = $Config{'ccflags'}; my $inc = '-I' . $Config{'incpath'} . ' -I./include' . ' -I' . + $includedir . '/taglib'; my $ldd = $Config{'lddlflags'} . ' ' . $Config{'ccdlflags'} . + ' ' . $Config{'cccdlflags'}; # Configure various os-es my $define; if ( $Config{'osname'} eq 'darwin' ) { $define = '-D_BSD_ICONV -DNO_DOXYGEN'; $libs .= ' -L/System/Library/Perl/lib/'. $Config{version}. ' -lper +l -liconv'; } elsif ( $Config{'osname'} eq 'freebsd' ) { $define = '-D_BSD_ICONV -DNO_DOXYGEN'; $libs .= ' -liconv'; } elsif ( $Config{'osname'} eq 'MSWin32' ) { # $define = '-D_BSD_ICONV -DNO_DOXYGEN'; # $define = '-DNO_DOXYGEN'; $libs .= ' -liconv'; } #$Verbose = 2; WriteMakefile( NAME => 'Audio::TagLib', MIN_PERL_VERSION => '5.008001', VERSION_FROM => 'lib/Audio/TagLib.pm', LICENSE => 'perl', CC => $CC, LD => '$(CC)', XSOPT => '-C++ -hiertype', CCFLAGS => $cflags, LIBS => $libs, DEFINE => $define, INC => $inc, LDDLFLAGS => $ldd, ( $Config{'version'} >= 5.005 ? ( ABSTRACT_FROM => 'lib/Audio/TagLib.pm', AUTHOR => 'Geoffrey Leach <gleach@cpan.org>' ) : () ), PREREQ_PM => { "Encode" => 0, "Test::Deep" => 0, "File::Slurp" => 0, "Test::More" => 0, "Test::Output" => 0, }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "Config" => 0, }, );

Hopefully this will encourage a C++ guru to look into this now that It's been narrowed down.

It's gotta be something stupid simple.

-Enjoy
fh :)_~