[osgeo4w-dev] Building rgdal for OSGeo4W

Roger Bivand Roger.Bivand at nhh.no
Sat Jan 17 14:49:51 EST 2009


I've come some way in building the rgdal.dll using MS compiler, etc., 
using the standard R Mingw failed, but if anyone is interested, I can 
document how. Before, MS compilers were used with FWTools.

For now I've stranded at:

cl /MT /Ox /EHsc /D "WIN32" /c /I "C:/Program Files/R/R-2.8.1/include" /I 
C:/OSGeo4W/include /I "C:\Program Files\Microsoft Visual Studio 
9.0\VC\include" *.cpp


link /dll /out:rgdal.dll /def:rgdal.def *.obj "C:\Program 
Files\R\R-2.8.1\bin\Rdll.lib" /libpath:"C:\Program Files\Microsoft Visual 
Studio 9.0\VC\lib" /libpath:"C:\Program Files\Microsoft 
SDKs\Windows\v6.0A\Lib" /libpath:"C:\OSGeo4W\lib" gdal_i.lib proj_i.lib

    Creating library rgdal.lib and object rgdal.exp
projectit.obj : error LNK2019: unresolved external symbol _pj_open_lib 
referenced in function _PROJ4NADsInstalled
rgdal.dll : fatal error LNK1120: 1 unresolved externals

Fails on missing _pj_open_lib. I guess this is because pj_open_lib() isn't 
in the API, so isn't in proj_i.lib. I need it for reaching into share/proj 
from within R (to see if NAD binaries are installed, and to load epsg into 
a data.frame in the R workspace). Any ideas?

Best wishes,


PS. If this can be fixed, the rgdal Windows binary and the installed 
R package could be shipped as an OSGeo4W package with access to any 
drivers in the GDAL package, which would be nice.

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no

More information about the osgeo4w-dev mailing list