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

From: nmarti <nate318i_at_yahoo.com>
Date: Wed, 30 Jul 2008 07:56:17 -0700 (PDT)

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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 30 Jul 2008 - 15:53:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Jul 2008 - 16:32:55 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive