Discussion:
[Gdal-dev] Building GDAL by MinGW
Hisaji Ono
2007-11-21 17:48:54 UTC
Permalink
Hi, Mr. Vine.

I can't still build GDAL by MinGW.

I tried to build latest gdal-cvs-030825 using following option under , as
you said, "separate" MinGW building environment. And gcc version number is
3.2.3.

./configure --prefix=$MINGW --host=i686-pc-mingw32 --with-libz=internal --w
ith-png=internal --with-libtiff=internal --with-geotiff=internal --without-
jpeg --without-python --without-pg

However I've got following error messages.

cplgetsymbol.cpp: In function `void* CPLGetSymbol(const char*, const
char*)':
cplgetsymbol.cpp:174: invalid conversion from `int (*)()' to `void*'
make[1]: *** [cplgetsymbol.o] Error 1
make[1]: Leaving directory `/home/Administrator/gdal-cvs-030825/port'
make: *** [port-target] Error 2

Could you give me any suggestion to deal with this error and go forward.

Regards.
Frank Warmerdam
2007-11-21 17:48:54 UTC
Permalink
Post by Hisaji Ono
Hi, Mr. Vine.
I can't still build GDAL by MinGW.
I tried to build latest gdal-cvs-030825 using following option under , as
you said, "separate" MinGW building environment. And gcc version number is
3.2.3.
./configure --prefix=$MINGW --host=i686-pc-mingw32 --with-libz=internal --w
ith-png=internal --with-libtiff=internal --with-geotiff=internal --without-
jpeg --without-python --without-pg
However I've got following error messages.
cplgetsymbol.cpp: In function `void* CPLGetSymbol(const char*, const
cplgetsymbol.cpp:174: invalid conversion from `int (*)()' to `void*'
make[1]: *** [cplgetsymbol.o] Error 1
make[1]: Leaving directory `/home/Administrator/gdal-cvs-030825/port'
make: *** [port-target] Error 2
Could you give me any suggestion to deal with this error and go forward.
Hisaji,

Assuming line 174 reads:
pSymbol = GetProcAddress( (HINSTANCE) pLibrary, pszSymbolName );

Try changing it to:
pSymbol = (void*) GetProcAddress( (HINSTANCE) pLibrary, pszSymbolName );

If this fixes the issue let me know and I will correct the master. The
code in this win32 implementation was written for VC++ and this may be the
first time it has been used with another compiler.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Hisaji Ono
2007-11-21 17:48:54 UTC
Permalink
Thank you very much, Mr. Warmerdam.
./configure --prefix=$MINGW --host=i686-pc-mingw32 --with-libz=internal --w
ith-png=internal --with-libtiff=internal --with-geotiff=internal --without-
Post by Frank Warmerdam
Post by Hisaji Ono
jpeg --without-python --without-pg
pSymbol = GetProcAddress( (HINSTANCE) pLibrary, pszSymbolName );
pSymbol = (void*) GetProcAddress( (HINSTANCE) pLibrary,
pszSymbolName );
Post by Frank Warmerdam
If this fixes the issue let me know and I will correct the master. The
code in this win32 implementation was written for VC++ and this may be the
first time it has been used with another compiler.
I could build this code. However I've still got following errors. Below
header files do exist.

gcc -I/home/Administrator/gdal-cvs-030825/port -I/home/Administrator/gdal-cv
s-03
0825/gcore -I/home/Administrator/gdal-cvs-030825/ogr -I/home/Administrator/g
dal-
cvs-030825/frmts -I/home/Administrator/gdal-cvs-030825/alg -c -Wall -O2
gdal
info.c -o gdalinfo.o
gdalinfo.c:116:18: gdal.h: No such file or directory
gdalinfo.c:117:25: ogr_srs_api.h: No such file or directory
gdalinfo.c:118:24: cpl_string.h: No such file or directory
gdalinfo.c:120: parse error before string constant
gdalinfo.c:120: warning: type defaults to `int' in declaration of
`CPL_CVSID'
gdalinfo.c:120: warning: data definition has no type or storage class
gdalinfo.c:123: parse error before "hDataset"
-----------------------------------------------

Regards.
Hisaji Ono
2007-11-21 17:48:54 UTC
Permalink
Hi.
gcc -I/home/Administrator/gdal-cvs-030825/port -I/home/Administrator/gdal-cv
Post by Hisaji Ono
s-03
0825/gcore -I/home/Administrator/gdal-cvs-030825/ogr -I/home/Administrator/g
Post by Hisaji Ono
dal-
cvs-030825/frmts -I/home/Administrator/gdal-cvs-030825/alg -c -Wall -O2
gdal
info.c -o gdalinfo.o
gdalinfo.c:116:18: gdal.h: No such file or directory
gdalinfo.c:117:25: ogr_srs_api.h: No such file or directory
gdalinfo.c:118:24: cpl_string.h: No such file or directory
gdalinfo.c:120: parse error before string constant
I've modified GNUMakefile as follows and could build GDAL at last. MinGW's
gcc seems not to like specifying fullpaths.

#INCLUDE = $(GDAL_INCLUDE) -I$(GDAL_ROOT)/frmts -I$(GDAL_ROOT)/alg
INCLUDE = -I../port -I../gcore -I../ogr -I../frmts -I../alg
-------------------------------------------------------------
CONFIG_LIBS = -L../ -lgdal.1.1 -lm -lm

Thanks.
Norman Vine
2007-11-21 17:48:54 UTC
Permalink
Post by Frank Warmerdam
pSymbol = GetProcAddress( (HINSTANCE) pLibrary, pszSymbolName );
pSymbol = (void*) GetProcAddress( (HINSTANCE) pLibrary, pszSymbolName );
If this fixes the issue let me know and I will correct the master. The
code in this win32 implementation was written for VC++ and this may be the
first time it has been used with another compiler.
Frank

This works

I had made this change in my MingW32 code but hadn't submitted a change

HTH

Norman

Loading...