[Gdal-dev] Some newbie can't open MrSID

Frank Warmerdam warmerdam at pobox.com
Thu Sep 16 13:58:28 EDT 2004

William Lyons wrote:
> Hello,
> After successfully building the source (kudos for the relatively
> painless build even in windows), I've been learning all I can about how
> to use GDAL from the online tutorials.  But, I have hit a snag.  I can't
> open MrSID files.  I tried the following:
>     GDALDatasetH  hDataset;
>     GDALAllRegister();
>     hDataset = GDALOpen( argv[1], GA_ReadOnly );
>     if( hDataset == NULL )
>     {
> 		printf("File not opened\n");
> 		return 1;
>     }
> 	const char *sidFormat = "MrSID";
>     GDALDriverH sidDriver = GDALGetDriverByName( sidFormat );
>     char **sidMetadata;
>     if( sidDriver == NULL )
> 	{
> 		printf( "No MrSID Support!!" );
>         exit( 1 );
> 	}


You haven't given much info on how you built the software.  Do you have
the MrSID SDK and did you modify your nmake.opt to use them?  If not then
you just don't have MrSID support!

One reason the GDAL windows build is *relatively* easy is that by default
all external dependences are disabled but with that goes lots of formats
that depend on external libraries.

If you have included the MrSID SDK then try doing a clean build.  Especially
on windows the makefile dependencies are often not sufficient to rebuild
all required components when the configuration or include files change.


   nmake /f makefile.vc clean
   nmake /f makefile.vc

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list