[gdal-dev] Re: GDAL 1.5.0 Perl Binding on Cygwin

Jingmu Yang jingmuyang at aol.com
Thu Jan 24 19:36:05 EST 2008


I experienced the same problem when I initially built GDAL 1.5.0 on 
Cygwin.  After analyzing the libraries I found that I had old GDAL 
libraries installed on /usr/local/lib/.  What I did was to delete those 
old libraries from /usr/local/lib and then built GDAL 1.5.0 without Perl 
binding.  After GDAL 1.5.0 was installed on /usr/local/ I built Perl 
binding as I described and I no longer have the link problems.

Hope this can help.

Jim

Paul Mallas wrote:
> I fixed this problem by editing a Cygwin script /usr/bin/perlld from:
>
> my $CC = 'gcc';
> to:
> my $CC = 'g++';
>
> This seems to fix other perl problems (non-GDAL) with Cygwin as well. 
> When I pointed this out, the Cygwin folks thought it was a bug but 
> wanted to investigate why this was set to gcc in the first place.
>
> Anyway, my problem remains with perl swig bindings on Cygwin. I know 
> Ari wants nothing more to do with this issue, but since we're on the 
> subject, maybe someone else might able to give me a clue.
>
> It seems I have a problem linking with the gdal lib with external 
> libs.  I get a ton of these types of messages below - I think the 
> issue has to do with the beginning underscore in the calls because 
> rikdataset.cpp calls "uncompress" not "_uncompress":
>
> /usr/local/lib/libgdal.a(rikdataset.o):rikdataset.cpp:(.text+0x519): 
> undefined reference to `_uncompress'
> /usr/local/lib/libgdal.a(jpeg2000dataset.o): In function 
> `_ZN18JPEG2000RasterBandC2EP15JPEG2000Datasetiii':
> /home/pmallas/gdal/frmts/jpeg2000/jpeg2000dataset.cpp:257: undefined 
> reference to `_jas_matrix_create'
> ....
>
> I am ignorant of how libraries get called - probably the windows 
> demands a prepended underscore for library calls or something. And I 
> know there are flags to manipulate leading underscores with g++ (like 
> -fleading-underscore), but I could never get them to work. I have 
> spent considerable time trying to sort this out with no luck.
>
> Any insights would be appreciated.
>
> jingmuyang at aol.com wrote:
>> I have successfully built GDAL 1.5.0 Perl binding on Cygwin and the 
>> followings might be helpful for those who experience problems.
>>
>> 1. Go to directory gdal-1.5.0/swig/perl and run 'perl Makefile.PL'.  
>> The following four Makefiles should be created if it succeeds:
>>
>> Makefile_Geo__GDAL
>> Makefile_Geo__GDAL__Const
>> Makefile_Geo__OGR
>> Makefile_Geo__OSR
>>
>> 2. Edit each of the four Makefiles by appending -lstdc++ after each 
>> -lgdal and save them.
>>
>> 3. Run make using each of the four Makefiles as follows:
>>
>> make -f Makefile_Geo__GDAL
>> make -f Makefile_Geo__GDAL__Const
>> make -f Makefile_Geo__OGR
>> make -f Makefile_Geo__OSR
>>
>> 4. Install the Perl Geo::GDAL package by running
>>
>> make -f Makefile_Geo__GDAL install
>>
>> That it.  Enjoy!
>>
>> Jim
>>
>> ------------------------------------------------------------------------
>> More new features than ever. Check out the new AOL Mail 
>> <http://o.aolcdn.com/cdn.webmail.aol.com/mailtour/aol/en-us/text.htm?ncid=aolcmp00050000000003>! 
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list