I read R extensions on calling R within c code. I am on windows vista, cygwin and R-2.13.0.I can compile & link the c code with following commands$gcc -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 -oRhello Rhello.o -lR However I cant run the resulting .exe file 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.exe I get a pop up window and it just hangs when I try to run exe file. I assume calling R via c program on cygwin/windowsvista is known to be working. if so, can some one comment on how to run above exe file. thanks-kris [[alternative HTML version deleted]]
On Jun 25, 2011, at 11:18 AM, Desi Ap wrote:> I read R extensions on calling R within c code. I am on windows > vista, cygwin and R-2.13.0.I can compile & link the c code with > following commands$gcc -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 -oRhello Rhello.o -lR > However I cant run the resulting .exe file 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.exe > I get a pop up window and it just hangs when I try to run exe file. > I assume calling R via c program on cygwin/windowsvista is known to > be working. > if so, can some one comment on how to run above exe file.It would be courteous posting behavior to put people on notice that this is an identical question to one posed earlier at SO: http://stackoverflow.com/questions/6478761/problem-running-c-code-that-has-r-in-it -- David Winsemius, MD West Hartford, CT
On Sat, Jun 25, 2011 at 4:18 PM, Desi Ap <desiap at yahoo.com> wrote:> I read R extensions on calling R within c code. I am on windows vista, cygwin and?R-2.13.0.I can compile & link the c code with following commands$gcc -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 -oRhello Rhello.o -lR > However I cant run the resulting .exe file 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.exe > I get a pop up window and it just hangs when I try to run exe file. I assume calling R via c program on cygwin/windowsvista is known to be working. > if so, can some one comment on how to run above exe file. > thanks-krisYou need to read the documentation to discover that maybe you should be using the right tools. Namely MinGW and not Cygwin. Unless you've managed to compile the whole of R using cygwin of course... I hope having identical responses to mailing list messages and SO questions isn't as annoying as seeing identical questions posted to each is to everyone on the list... Barry