[R] changes in behaviour of Rcmd SHLIB since 2.4.0
Jan.Kleinn at partnerre.com
Jan.Kleinn at partnerre.com
Wed Mar 28 16:10:49 CEST 2007
Dear all,
I have some C code using the zlib uncompress. It compiles fine under Win XP
(with SP2) with R up to 2.3.1 and generates four files (Makedeps, *.d,
*.dll, and *.o):
C:\Data\R-packages\cmg>rcmd SHLIB cmg.c -o cmg.dll
latex: not found
making cmg.d from cmg.c
gcc -IC:/PROGRA~1/R/R-2.3.1/include -Wall -O2 -c cmg.c -o cmg.o
cmg.c: In function `readcmg':
cmg.c:33: warning: assignment from incompatible pointer type
cmg.c:40: warning: assignment from incompatible pointer type
cmg.c:50: warning: assignment from incompatible pointer type
gcc -shared -s -o cmg.dll cmg.def cmg.o -LC:/PROGRA~1/R/R-2.3.1/bin
-lR
With R 2.4.0 and later, the compilation fails at the linking, so the four
files generated are Makedeps, *.d, *.def, and *.o:
C:\Data\R-packages\cmg>rcmd SHLIB cmg.c -o cmg.dll
latex: not found
making cmg.d from cmg.c
gcc -IC:/PROGRA~1/R/R-2.4.1/include -Wall -O2 -std=gnu99 -c cmg.c -o
cmg.o
cmg.c: In function `readcmg':
cmg.c:33: warning: assignment from incompatible pointer type
cmg.c:40: warning: assignment from incompatible pointer type
cmg.c:50: warning: assignment from incompatible pointer type
gcc -shared -s -o cmg.dll cmg.def cmg.o -LC:/PROGRA~1/R/R-2.4.1/bin
-lR
cmg.o:cmg.c:(.text+0xc0): undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [cmg.dll] Error 1
I have seen the page by Duncan Murdoch
(http://www.murdoch-sutherland.com/Rtools/), that since 2.4.0 you need
MinGW runtime 3.11 or higher, so I reinstalled the whole MinGW (runtime now
3.11, gcc core and C++ compiler now 3.4.5) and ActivePerl (now 5.8.8. build
820) but the problem persists.
Any ideas or hints on how I could compile my C code with the current
version of R are highly welcome.
Many thanks in advance and best regards, Jan
DISCLAIMER: This e-mail contains information solely intended...{{dropped}}
More information about the R-help
mailing list