Re: [Rd] R CMD SHLIB in Windows XP - No output at all

From: William Dunlap <>
Date: Thu, 16 Feb 2012 01:26:58 +0000

Does the following example help? I installed Duncan Murdoch's Rtools-2.13 into E:\Rtools-2.13 and R into E:\Program Files\R\R-2.14.1. I put a small file of C code into E:\temp\junk.c. Here is record of what I did after opening a new cmd.exe window. Setting PATH is critical: put the 2 bin directories under Rtools first in PATH. You might want R_HOME\bin early too, if you already have some other R_HOME directory in your standard PATH.

C:\Documents and Settings\wdunlap>set PATH=e:\Rtools-2.13\bin;e:\Rtools-2.13\MinGW\bin;%PATH%;e:\Program Files\R\R-2.14.1\bin

C:\Documents and Settings\wdunlap>e:

E:\>cd \temp

E:\temp>R CMD SHLIB -o junk.dll junk.c
cygwin warning:
  MS-DOS style path detected: E:/PROGRA~1/R/R-214~1.0/etc/i386/Makeconf   Preferred POSIX equivalent is: /cygdrive/e/PROGRA~1/R/R-214~1.0/etc/i386/Makeconf   CYGWIN environment variable option "nodosfilewarning" turns off this warning.   Consult the user's guide for more details about POSIX paths: gcc -I"E:/PROGRA~1/R/R-214~1.0/include" -I"d:/RCompile/CRANpkg/extralibs/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c junk.c -o junk. o
gcc -shared -s -static-libgcc -o junk.dll tmp.def junk.o -Ld:/RCompile/CRANpkg/extralibs/local/lib -LE:/PROGRA~1/R/R-214~1.0/bin/i386 -lR

E:\temp>type junk.c
void my_junk(double *x)

    *x = *x + 100.0;

... [elided startup messages] ...
> dyn.load("junk.dll")
> .C("my_junk", pi) # expect to get 100+3.14159265...
[1] 103.1416


Bill Dunlap
Spotfire, TIBCO Software
> -----Original Message-----
> From: [] On Behalf Of Lorenzo
> Sent: Wednesday, February 15, 2012 4:03 PM
> To:
> Subject: Re: [Rd] R CMD SHLIB in Windows XP - No output at all
> Hi Duncan,
> Thanks for your help, I am actually using R Windows version 2.14.1 (22th Dec
> 2011).
> Actually by "R CMD SHLIB *.*" I actually meant putting any file name after
> the R CMD SHLIB ("R CMD SHLIB convolve.c" for example).
> Another case which fails is : creating a Rcpp Armadillo package skeleton
> (named MyPackage for example) and trying the R CMD INSTALL MyPackage. Fails
> as well on the R CMD SHLIB line.
> What I actually don't understand is how the R CMD SHLIB command links to the
> RTools cygwin and mingw.
> It really looks like the "make" function works in my command line when I use
> it directly but the link between R CMD SHLIB and cygwin fails...
> --
> View this message in context:
> all-tp4385797p4392482.html
> Sent from the R devel mailing list archive at
> ______________________________________________
> mailing list
> mailing list Received on Thu 16 Feb 2012 - 01:29:59 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 16 Feb 2012 - 05:10:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive