[Rcpp-devel] package with module not compiling on Mac

Robin Girard robin.girard at mines-paristech.fr
Thu Jan 31 12:15:39 CET 2013


Merci Romain ! 

I am doing this to make possible a direct use of the result such as in A=Sum(f1.Swap(0),f2.Etoile())
This is not really necessary but sometime convenient. That's old prog souvenirs for me so please correct me if this is stupid. 

Can it be that my clone is wrong ? (indeed I am not sure to really understand how it works) 

	cplfunction* clone(){
		return new cplfunction() ;
	}

I will try to make it by adapting the two functions and their use !
Robin


----- Mail original -----
De: "Romain Francois" <romain at r-enthusiasts.com>
À: rcpp-devel at lists.r-forge.r-project.org
Envoyé: Jeudi 31 Janvier 2013 11:52:19
Objet: Re: [Rcpp-devel] package with module not compiling on Mac

Hello,

I can reproduce the compiler error on my mac. If I comment the methods 
Swap and Etoile, then I can compile the package.

Now looking at the signatures:

cplfunction & Swap(double y) ;
cplfunction & Etoile() ;

I think the problem is that they return a reference. Looking at their 
code, it looks like they only ever return *this. Why are you doing this ?

I'd suggest you return void.

Romain

Le 29/01/13 16:04, Robin Girard a écrit :
>
> The Mac version of my package http://cran.r-project.org/web/packages/ConConPiWiFun/index.html
> (using Rcpp module) does not compile.
> the error message is here
> http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/ConConPiWiFun-00install.html
>
> and contains "no matching function for call to 'module_wrap(cplfunction&)'" does it means that I might have called things in the wrong order in my cpp code ?
>
> my cpp code starts like that
> #include <map>
> #include <math.h>
> #include <limits>
> #include <Rcpp.h>
>
> using namespace std;
> using namespace Rcpp;
> class cplfunction ;
> RCPP_EXPOSED_CLASS(cplfunction)
>
>
> is there something like win-builder but for mac ?
>
> All the best
> Robin
>
> Dr. Girard Robin
> Chargé de Recherche
>
> MINES-ParisTech / Département Energétique et Procédés / PERSEE / Groupe ERSEI
> Centre Procédés, Energies Renouvelables et Systèmes Energétiques (PERSEE)
> Center for Processes, Renewables Energies and Energy Systems
> Renewable Energies & Smartgrids (ERSEI)
>
> 1 Rue Claude Daunesse - CS 10207 - F-06904 Sophia Antipolis Cedex
> Tel: +33.4.93.67.89.64 (~99), Fax: +33.4.93.95.75.35
> e-mail : robin.girard at mines-paristech.fr
>
> web page perso http://www.mines-paristech.fr/Services/Annuaire/&?id=8828
> statoverflow : http://stats.stackexchange.com/users/223/robin-girard
> web page centre PERSEE : http://www.cep.mines-paristech.fr/
> linkedin : http://www.linkedin.com/profile/view?id=14907272&trk=tab_pro
>
> Le lien vaut mieux que le bien.
> ________________________________________________________
>
> CONFIDENTIALITY : This  e-mail  and  any attachments are
> confidential and may be privileged. If  you are not a
> named recipient, please notify the sender immediately and
> do not disclose the contents to another person, use it for
> any purpose or store or copy the information in any medium.
>
> CONFIDENTIALITE : Ce message et les éventuelles pièces
> attachées sontconfidentiels et peuvent être une
> communication protégée. Si vous n'êtes pas dans la liste
> des destinataires, veuillez informer l'expéditeur
> immédiatement et ne pas ouvrir ni divulguer le contenu
> à une tierce personne, ne pas l'utiliser pour quelque
> raison que ce soit, ne pas stocker ou copier l'information
> qu'il contient sur un quelconque support.
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30

R Graph Gallery: http://gallery.r-enthusiasts.com

blog:            http://romainfrancois.blog.free.fr
|- http://bit.ly/RE6sYH : OOP with Rcpp modules
`- http://bit.ly/Thw7IK : Rcpp modules more flexible

_______________________________________________
Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list