-1

I am using following thread as basis for writing C code with R in it R from C -- Simplest Possible Helloworld

i could compile and link c code with following cmds

$ gcc -Wall -I/cygdrive/c/Progra~1/R/R-2.13.0/include -c -ggdb Rhello.c 

$ gcc -L/cygdrive/c/Progra~1/R/R-2.13.0/bin/i386 -o Rhello Rhello.o -lR

However I canNOT run the resulting executable with following command:

$ LD_LIBRARY_PATH=/cygdrive/c/Progra~1/R/R-2.13.0/bin R_HOME=/cygdrive/c/Progra~1/R/R-2.13.0 ./Rhello

All I get is a popup window saying "..stopped working...". I am on widowsvista & cygwin. can someone tell me what is the wrong with the above cmd.

thanks kris

Community
  • 1
  • 1
kris
  • 1
  • 1
  • Can you confirm that you *can* compile and run a simple (non-R linking) C file that does the usual printf("hello world\n") test? Just so we know your basic compiler isn't broken before we start hunting problems on what's essentially Microsoft's worst OS ever (yet). – Spacedman Jun 25 '11 at 22:50
  • Also cygwin wtf? You need the MinGW toolchain as documented in the documentation. Unless you've managed to compile R with cygwin of course... – Spacedman Jun 25 '11 at 22:59
  • Cygwin is not broken and it works just fine for regular C and C++ programming. – kris Jun 25 '11 at 23:48

1 Answers1

1

You should be looking at getting RTools and reading the basics and perhaps more documentation

IRTFM
  • 258,963
  • 21
  • 364
  • 487