[Rd] Interfacing C-code (gets and printf) under WINDOWS (Visual C++)

From: Renard Didier <didier.renard_at_ensmp.fr>
Date: Fri 03 Feb 2006 - 07:25:00 GMT


Hi

I try to develop a R interface to a set of C routines, in order to produce a R-package on Geostatistics.
My C-code uses interaction with the user as I use printf and gets statements.
I develop the code in a LINUX environment and do not face any problem having the questions and answers routed on my current Terminal. When I tried to port the package on Windows, the problems began. No message was routed to the Console and I could not enter any answer. Let me first admit that I am not a specialist of the WINDOWS environment. I started looking for an answer on the WEB and intercepted some pieces of answers ... but I did not succeed in getting a workable solution. This is the reason why I put this open question here today.

I did not find lots of information about the gets solution. Finally, I have chosen to use R_WriteConsole and R_ReadConsole which seemed to be promising solutions. I discovered an information saying that starting R-2.0.1, the include file R-interface.h could help me. This is the reason why I downloaded the latest version available on the R site (R-2.2.1). Unfortunately, I did not find such a file in the include directory. Moreover, in Visual C++ that I am using for building my DLL, I need to find the LIBRARY containing the objects of these two routines. Did I do something wrong. Do I need to download other contributions first. Do I use incorrect routines ?

Thank you for your help.

Didier RENARD



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Feb 03 18:41:37 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:40 GMT