
21 Set
2015
21 Set
'15
00:54
Prezados, Gostaria de uma ajuda em como fazer a soma de 1+1 mas usando a interface entre R e C. a chamada da função .Call faz travar e fechar o R. Agradeço por qualquer ajuda nisso Cleber # um CMR (do conceito) abaixo: ################################################ > texto_code <-" + #include <stdlib.h> + #include <R.h> + #include <Rdefines.h> + + void testef( double *k, double *res ) + { + res = k + 1; + } + " > > sink('teste.c') > cat( texto_code ) > sink() > > system("R CMD SHLIB teste.c") cygwin warning: MS-DOS style path detected: C:/R/etc/x64/Makeconf Preferred POSIX equivalent is: /cygdrive/c/R/etc/x64/Makeconf CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames gcc -m64 -I"C:/R/include" -DNDEBUG -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -std=gnu99 -mtune=core2 -c teste.c -o teste.o gcc -m64 -shared -s -static-libgcc -o teste.dll tmp.def teste.o -Ld:/RCompile/r-compiling/local/local320/lib/x64 -Ld:/RCompile/r-compiling/local/local320/lib -LC:/R/bin/x64 -lR > dyn.load( "teste.dll" ) > is.loaded( 'testef' ) [1] TRUE > > k=1 > ############################ ########## # ( .Call('testef', k=as.double(k), res=as.double(0) ) ) # # aqui o R trava e fecha !!!!!!!!!!!!!!!!!!!!!! --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus