From qk at st-andrews.ac.uk  Wed Oct  8 18:57:12 2014
From: qk at st-andrews.ac.uk (Qiao Kang)
Date: Wed, 8 Oct 2014 17:57:12 +0100
Subject: [Rd] RCMD SHLIB problem in 64 bits
Message-ID: <CAGKjpr6bZ7UpDnaVwY-i5wxc5c9KQXju4pvodXD1EUcaOgTkbw@mail.gmail.com>

I am trying to build a dll writen in C to be called by R.

Interestingly, when I set the global environment variable PATH to be
"c:\Rtools\bin;C:\Rtools\gcc-4.6.3;C:\Program Files\R\R-3.1.1\bin\*i386*;"
and I typed "RCMD SHLIB Permutation.c" in Cygwin, the dll was compiled and
I can sucessfully call functions after I had loaded it into 32 bits R via
.Call.

However,  now I want to run the same function in 64 bits R. I changed
the global environment variable PATH to be
"c:\Rtools\bin;C:\Rtools\gcc-4.6.3;C:\Program Files\R\R-3.1.1\bin\*x64*;",
opened Cygwin again and typed "RCMD SHLIB Permutation.c" in Cygwin. Error
message appeared on Cywin console.

$ RCMD SHLIB Permutation.c
gcc -m64 -shared -s -static-libgcc -o Permutation.dll tmp.def Permutation.o
-Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64
-Ld:/RCompile/CRANpkg/extralibs64/local/lib
-LC:/PROGRA~1/R/R-31~1.1/bin/x64 -lR
C:/PROGRA~1/R/R-31~1.1/bin/x64/R.dll: file not recognized:

My version of R is the latest 3.1.1 and my Rtools is also the latest
version 31

I am not sure why this is happening and I have been struggled about this
for two days.

	[[alternative HTML version deleted]]



[Rd] RCMD SHLIB problem in 64 bits
Qiao Kang