# Unable to Build gdal 1.9.0 on 9-RELEASE



## aorchid (May 31, 2012)

Hello,

I am trying to upgrade the KDE metaport and it seems that gdal is needing an upgrade to 1.9.0. I am on 9.0-RELEASE amd64. gdal continues to fail in the build with the same error. It seemed related to swig, which I did not have installed. I have since tried to build gdal after installation of either swig13 or swig20 and it does not help. I do not see an option in the gdal config to turn off something related to swig. I have only the default options set. 

Any suggestions would be greatly appreciated. 

Thanks, Aric


```
extensions/gdalconst_wrap.c:2807: error: parameter 'swig_cast_initial' is initialized
extensions/gdalconst_wrap.c:2808: warning: initialization from incompatible pointer type
extensions/gdalconst_wrap.c:2814: error: storage class specified for parameter 'swig_const_table'
extensions/gdalconst_wrap.c:2814: error: parameter 'swig_const_table' is initialized
extensions/gdalconst_wrap.c:2815: warning: braces around scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2815: warning: excess elements in scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2815: warning: excess elements in scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2815: warning: excess elements in scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2815: warning: excess elements in scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2815: warning: excess elements in scalar initializer
extensions/gdalconst_wrap.c:2815: warning: (near initialization for 'swig_const_table')
extensions/gdalconst_wrap.c:2874: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3027: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3077: error: storage class specified for parameter 'swig_globalvar'
extensions/gdalconst_wrap.c:3081: error: expected specifier-qualifier-list before 'swig_globalvar'
extensions/gdalconst_wrap.c:3082: error: storage class specified for parameter 'swig_varlinkobject'
extensions/gdalconst_wrap.c:3085: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3094: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3132: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3143: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3154: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3171: error: expected ')' before '*' token
extensions/gdalconst_wrap.c:3188: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3248: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3257: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3274: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3286: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3316: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
extensions/gdalconst_wrap.c:3366: error: expected declaration specifiers before '__attribute__'
extensions/gdalconst_wrap.c:3514: error: old-style parameter declarations in prototyped function definition
/usr/ports/graphics/gdal/work/gdal-1.9.0/port/cpl_vsi.h:81: error: parameter name omitted
/usr/ports/graphics/gdal/work/gdal-1.9.0/port/cpl_vsi.h:81: error: parameter name omitted
extensions/gdalconst_wrap.c:3514: error: expected '{' at end of input
error: command '/bin/sh' failed with exit status 1
gmake[2]: *** [build] Error 1
gmake[2]: Leaving directory `/usr/ports/graphics/gdal/work/gdal-1.9.0/swig/python'
gmake[1]: *** [build] Error 2
gmake[1]: Leaving directory `/usr/ports/graphics/gdal/work/gdal-1.9.0/swig'
gmake: *** [swig-modules] Error 2
*** Error code 1

Stop in /usr/ports/graphics/gdal.
*** Error code 1

Stop in /usr/ports/graphics/gdal.
```


----------



## frabron (Jun 5, 2012)

Hi,

I'm also struggling to update my gdal, but with another error. But I found something related to your SWIG problem on Nabble, maybe it can help you: http://freebsd.1045724.n5.nabble.com/graphics-gdal-1-9-0-does-not-build-on-CURRENT-td5710844.html. May I ask how you got past the iconv issue mentioned here?


----------



## aorchid (Jun 6, 2012)

It turns out that my swig associated error is because I was building gdal with the Python option turned on. I did not realize this. Removing the Python option from gdal's make file (the default is off) allowed gdal to build. Maybe I would need to build Python differently to have the swig option on. I don't know. I do know that there is/was a problem on 10-CURRENT related to swig and gdal as well, as you point out.

Fortunately I have not had the iconv error you mention. Sorry I cannot be of help with that.

Aric


----------



## frabron (Jun 6, 2012)

This is unfortunate for me, but thanks anyway for replying. Then I'll wait for the 1.9.1 release ...


----------



## bart (Jun 6, 2012)

What are your options?


----------



## frabron (Jun 7, 2012)

My options? Sorry, but I don't understand what you want to know from me here ...


----------



## danger@ (Jun 11, 2012)

He wants you to send the output of this command:

`# make showconfig`


----------



## frabron (Jun 12, 2012)

Ah, OK, but this is not necessary anymore. Sunpoet, the maintainer of the port is preparing a new release with 1.9.1. In this version my problem is solved.


----------



## danger@ (Jun 12, 2012)

I know, he told me he's planning to commit the update today. Let's see how it works out, as I am waiting for it as well


----------

