[Rd] Compiling PL/R against R.dll in Win32/MinGW

Mike Leahy mgleahy at alumni.uwaterloo.ca
Fri Apr 7 21:45:38 CEST 2006

Hello list,

I've been trying to get the PostgreSQL PL/R library to compile on
windows (http://www.joeconway.com/plr/).  The author of this library
says the problem is likely because the distributed R.dll isn't compiled
as a shared dll.  Is this the case?  If so, is there any way to compile
it such that it is shared?  If that's not the case, than maybe someone
on this list has a better understanding of the errors I'm getting (below).

Thanks in advance for any suggestions.


gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
  -I. -Ic:/Progra~1/R/R-2.3.0alpha/include
-Ic:/Progra~1/R/R-2.3.0alpha/include -I. -Ic:/MinGW/include/server
ude/internal -I./src/include/port/win32 -DEXEC_BACKEND
-Ic:/MinGW/include/server/port/win32 -Ic:/msys/src/pgsql/src/include
-Ic:/msys/src/pgsql/src/include/port/win32 -DPKGLIBDIR=\
"c:/MinGW/lib\" -DDLSUFFIX=\".dll\"  -c -o pg_rsupport.o pg_rsupport.c
dlltool --export-all  --output-def plr.def plr.o pg_conversion.o
pg_backend_support.o pg_userfuncs.o pg_rsupport.o
dllwrap  -o libplr.dll --dllname libplr.dll  --def plr.def plr.o
pg_conversion.o pg_backend_support.o pg_userfuncs.o pg_rsupp
ort.o -Lc:/Progra~1/R/R-2.3.0alpha/bin -Lc:/Progra~1/R/R-2.3.0alpha/bin
-Lc:/MinGW/lib -Lc:/MinGW/lib -lR -lpostgres
Info: resolving _pkglib_path by linking to __imp__pkglib_path (auto-import)
Info: resolving _Dynamic_library_path by linking to
__imp__Dynamic_library_path (auto-import)
plr.o(.text+0xe3):plr.c: undefined reference to `Rf_initEmbeddedR'
pg_conversion.o(.text+0x12d3):pg_conversion.c: undefined reference to
fu000061.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000062.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000064.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
nmth000060.o(.idata$4+0x0): undefined reference to `_nm__pkglib_path'
nmth000063.o(.idata$4+0x0): undefined reference to
collect2: ld returned 1 exit status
c:\MinGW\bin\dllwrap.exe: c:\MinGW\bin\gcc exited with status 1
make: *** [libplr.a] Error 1

More information about the R-devel mailing list