[R] Rprintf will not build in my C++ compiler

nmarti nate318i at yahoo.com
Wed Jul 30 16:56:17 CEST 2008


I have searched through the threads and "Rprintf" causing a build error
dosen't seem to be a problem for anyone else.  And I've read through "R
Extensions" and "An Introduction to the .C Interface to R" and there doesn't
seem to be any troubleshooting for my problem.

My code is straight from "An Introduction to the .C Interface to R" pg. 3.
And my compiler is VC++ 2005 Express
----------------------
#include <R.h>

void hello( int *n ) {
    int i ;
    for( i = 0 ; i < *n ; i++ ) {
        Rprintf( "Hello, world!\n" ) ;
    }
}
----------------------
When I try to build this code, I recieve 2 error massages,
"error LNK2019: unresolved external symbol _Rprintf referenced in function
"void _cdecl hello(int *n)" (?hello@@YAXPAH at Z)"
"fatal error LNK1120: 1 unresolved externals"

To be honest, I'm not exactly sure what these errors mean, I'm still
learning C++.
Any thoughts would be appreciated.
-- 
View this message in context: http://www.nabble.com/Rprintf-will-not-build-in-my-C%2B%2B-compiler-tp18735205p18735205.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list