Thank you for your help. So far what I did on my notebook as follows. My OS
is windows7.
Â
I downloaded Rcpp windows version, and load library("Rcpp") then.
Â
1, Change main funnction to f1.cpp, remove makefile.
2 ,run Rcpp.package.skeleton(name="test",list=c("rec1.R","rect2.R"))
3, edit  /man, /R, copied my exist file whch I have done sucessfullyÂ
without any c++ program before.
4, copy f1.cpp and all other related cpp and c into /src/
5. Rcmd build --binary test
Â
It showed------
Â
making DLL....
gcc
-lâC:/PROGRA~2/R/R-210~1.1/include",âC:/PROGRA~2/R/R-210~1.1/bin/Rscript
-e' Rcpp:::CxxxFlags<>'` -03 -Wall -std =gnu -999 -c cranbombind.c -o
cranbombind.o
Â
gcc.exe: **\Documents/R/win-library/2.10/Rcpp/lib: No such file or directory...
I checked the path, it did have C:\Users\alex
**\Documents\R\win-library\2.10\Rcpp\lib
Â
I don't know how I can fix the problem. do you think it could be problem there
is a space between my first name and last name..
Â
All I tried are on my own PC at home , I will tryon other  PC in my office.
Â
Do you have suggestion?. Thanks,
Â
Alex
--- On Sun, 3/7/10, Romain Francois <[email protected]> wrote:
From: Romain Francois <[email protected]>
Subject: Re: [Rd] for help on building a R package with several R function and
a bunch of c, c++
To: [email protected]
Cc: "Dirk Eddelbuettel" <[email protected]>, [email protected]
Date: Sunday, March 7, 2010, 3:59 AM
On 03/06/2010 03:27 AM, [email protected] wrote:
> I think the first question should be how to build a R function to call a
> bunch of C ,C++ which include one main program, and a makefile. My goal to
> build a R package will be next step.
You should jump straight to making a package. You are making you life
difficult with this "main program & makefile" model.
Install Rcpp and try to use the Rcpp.package.skeleton, this will create
a simple package that uses some C++ classes from Rcpp, as well as an R
function that calls them.
> I read Rcpp , I am not sure if RcppResultSet can solve my problem or other
> function. Once I make sure it work I need ask UNIX adminstrator to install it.
We don't know what your problem is. We can answer a question, but we
cannot guess the question for you.
Rcpp works, please refer to our unit tests, for example look at this
vignette:
http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-unitTests.pdf
> I think it shouldn't be very complex, as I know to build a R function easy
> with one C function.
>
> Thanks you for yout attention!
>
> Alex
>
> --- On Fri, 3/5/10, Dirk Eddelbuettel<[email protected]>Â wrote:
>
>
> From: Dirk Eddelbuettel<[email protected]>
> Subject: Re: [Rd] for help on building a R package with several R function
> and a bunch of c, c++
> To: [email protected]
> Cc: [email protected]
> Date: Friday, March 5, 2010, 8:25 PM
>
>
>
> On 5 March 2010 at 13:15, [email protected] wrote:
> | Hope I can get quick help from here, I have a bunch of c, c++ included main
> function and makefile. It works well on both UNIX and windows. I tried to
> build R package which include this C++ program and several other R
> functions. These R function here are independent of c++ code. I prefer to
> define one R function to call this c++ program (main function).
> |
> | I know how to build R package with just R function, but I don't know how to
> handle those c++ c code after I copied those code in ./src, I am reading
> manual "Writing R Extensions" , but I did n't catch the key point . Do you
> know any easy way to do it? ,
>
> When you asked _that exact same question_ this morning on r-help, you got the
> following answer:
>
>Â Â Â Â From: Whit Armstrong<[email protected]>
>Â Â Â Â To: [email protected]
>Â Â Â Â Cc: [email protected]
>Â Â Â Â Subject: Re: [R] for help on building a R package with several R
>function and a bunch of c, c++
>Â Â Â Â Date: Fri, 5 Mar 2010 10:33:54 -0500
>
>Â Â Â Â Pick up Rcpp, make your life easier.
>
>Â Â Â Â http://dirk.eddelbuettel.com/code/rcpp.html
>
>Â Â Â Â -Whit
>
>Â Â Â Â On Fri, Mar 5, 2010 at 9:19 AM,<[email protected]>Â wrote:
>Â Â Â Â >Â Hope I can get quick help from here, I have a bunch of c, c++
>included main function and makefile. It works well on both UNIX and windows. I
>tried to build R package which include this C++ program and several other R
>functions. R function here are independent c++ code. I prefer to define
>one R function to call this c++ program.
>Â Â Â Â >
>Â Â Â Â >Â Do you know any easy way to do it? I am reading manual "Writing R
>Extensions", I didn't catch the key point. I know how to build R package with
>just R function, If I put all c++ code and makefile in /src...what I need do?
>Â Â Â Â >
>Â Â Â Â >Â Thank you in advance!
>Â Â Â Â >
>Â Â Â Â >Â Alex
>
> Now, can you let us know
>
>Â Â Â a) what part of the answer was unclear to you, and
>
>Â Â Â b) what made you think you needed to repost _the identical question_
>here
>
> | Thank you in advance!
>
> You're welcome.
>
> Dirk
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7
`- http://tr.im/O1wO : highlight 0.1-5
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel