[Rcpp-devel] Rcpp::binding_not_found error

Alessandro Torrisi alessandro.torrisi at gmail.com
Fri Sep 24 16:26:49 CEST 2010


Here it is the archive.

I'm trying to give you all the details...

I have an header where I declare:

#ifndef PORTFOLIOPERFORMANCEINPUT_H
#define PORTFOLIOPERFORMANCEINPUT_H

#include <vector>
#include <string>
#include <time.h>
#include <RInside.h>

using namespace Rcpp;
using namespace std;

class PortfolioPerformanceInput
{
public:
        PortfolioPerformanceInput();
        virtual ~PortfolioPerformanceInput();

        vector<string> libraries;

        vector<double> nav;
        //vector< vector<double> > cashFlows;
        NumericMatrix cashFlows;

        string creationDate;
        string activationDate;
        string finalDate;
        string benchmark;
        vector<string> dates;
        vector<string> datesBmk;
        //vector< vector<double> > indexesBmk;
         NumericMatrix indexesBmk;
        //vector< vector<double> > weightsBmk;
        NumericMatrix weightsBmk;
        double start;
        string type;

    protected:
    private:

};

when I use it I do:

    NumericMatrix m(5,3);

    for (unsigned i = 0; i < 5; i++)
    {
        for (unsigned k = 0; k < 3; k++)
        {
            m(i,k) = 100 + k;
        }
    }

then:

    ...
    PortfolioPerformanceInput *ppi;
    ppi = new PortfolioPerformanceInput;
    ppi->cashFlows = m;

when I execute this code I have the famous fault.

The app is really small... 6 files and it is just for me not for my company
:-)

Best regards,
Alex.



On Fri, Sep 24, 2010 at 3:56 PM, Romain Francois
<romain at r-enthusiasts.com>wrote:

> Le 24/09/10 15:23, Alessandro Torrisi a écrit :
>
>  I tried with Rcpp::NumericMatrix but I have segmentation fault :-(
>> This is probably because I'm learning C++ just now...and I don't know
>> how to deal with pointers and so on...
>>
>
> If you want help, you are going to need to provide some more details.
>
>
>  I don't know how to declare NumericMatrix in my objects... if I do it I
>> have segfault...
>>
>
> What did you do ?
>
>
>  How can I send you the source archive ? Is it possible to attach them in
>> ML ?
>>
>
> You can attach files. However, please trim your code to something small
> that maintains the problem. I'm not interested in debugging entire
> applicatons ... not for free anyway ;-)
>
> Romain
>
>  Thanks !
>>
>> On Fri, Sep 24, 2010 at 2:55 PM, Romain Francois
>> <romain at r-enthusiasts.com <mailto:romain at r-enthusiasts.com>> wrote:
>>
>>    Le 24/09/10 14:51, Alessandro Torrisi a écrit :
>>
>>        Installed versions:
>>
>>        Rcpp "Rcpp" "/usr/lib/R/site-library" "0.8.6"
>>        RInside "RInside" "/usr/lib/R/site-libRomain Francois
>>        <romain at r-enthusiasts.com
>>        <mailto:romain at r-enthusiasts.com>>rary" "0.2.3"
>>
>>
>>        About the example, what do you exactly need ? I'm a newbie :-D
>>
>>
>>    Something self contained I can compile on my machine and that shows
>>    the error you see.
>>
>>
>>        I ran the tests and everything seems to go fine with their
>>        compilation
>>        and execution.
>>        I can't see any errors, only "good" output from R and C++.
>>
>>
>>    That's good news. It means we really need to see your example.
>>
>>
>>        About the vector< vector<double> > I'm trying to set a matrix
>>        instead of
>>        a list of vectors because the source of our portfolioBenchmark
>>        function
>>        needs that kind of data type.
>>
>>
>>    Do you have to store it as a vector< vector<double> > ?
>>    Can't you use, e.g. a Rcpp::NumericMatrix ?
>>
>>    Romain
>>
>>        Thanks again,
>>        Alex
>>
>>        On Fri, Sep 24, 2010 at 1:55 PM, Dirk Eddelbuettel
>>        <edd at debian.org <mailto:edd at debian.org>
>>        <mailto:edd at debian.org <mailto:edd at debian.org>>> wrote:
>>
>>
>>            On 24 September 2010 at 13:41, Romain Francois wrote:
>>            | > My environment is Linux Ubuntu 32 bit with R version 2.11.1
>>            (2010-05-31).
>>            | > Do you need more info ?
>>            |
>>            | What versions of Rcpp and RInside are you using ?
>>            |
>>            | It would be useful if you can provide a small reproducible
>>        example so
>>            | that we can debug it on our end.
>>
>>            Also, do all RInside examples work for you?  Do something like
>>
>>            edd at max:~/svn/rcppbook/papers/rjournal-2010$ mkdir /tmp/check
>>            edd at max:~/svn/rcppbook/papers/rjournal-2010$ cd /tmp/check/
>>            edd at max:/tmp/check$ cp -vax
>>            /usr/local/lib/R/site-library/RInside/examples/standard/* .
>>            edd at max:/tmp/check$ make
>>
>>            and run the examples via
>>
>>            edd at max:/tmp/check$ make runAll
>>
>>            Some of these do run portfolio optim. tests from Rmetrics so
>>        it'll
>>            give you
>>            an idea. They should all work on released pairs of Rcpp +
>>        RInside --
>>            it is
>>            part of our testing.
>>
>>            Dirk
>>
>>
>>            --
>>            Dirk Eddelbuettel | edd at debian.org <mailto:edd at debian.org>
>>        <mailto:edd at debian.org <mailto:edd at debian.org>> |
>>
>>
>>        http://dirk.eddelbuettel.com
>>
>>
>>
>>
>>        --
>>        Alessandro Torrisi
>>        Information Technology Consultant
>>        Email: alessandro.torrisi at gmail.com
>>        <mailto:alessandro.torrisi at gmail.com>
>>        <mailto:alessandro.torrisi at gmail.com
>>        <mailto:alessandro.torrisi at gmail.com>>
>>
>>        Skype: alessandro.torrisi
>>        Tel: +39/333/2442546
>>
>>        "Questo documento è formato esclusivamente per il destinatario.
>>        Tutte le
>>        informazioni ivi contenute, compresi eventuali allegati, sono
>>        soggette a
>>        riservatezza a termini del vigente D.Lgs. 196/2003 in materia di
>>        "privacy" e quindi ne è proibita l'utilizzazione. Se avete
>>        ricevuto per
>>        errore questo messaggio, Vi preghiamo cortesemente di contattare
>>        immediatamente il mittente e cancellare la e-mail. Grazie."
>>
>>
>>
>>        _______________________________________________
>>        Rcpp-devel mailing list
>>        Rcpp-devel at lists.r-forge.r-project.org
>>        <mailto: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
>>    http://romainfrancois.blog.free.fr
>>    |- http://bit.ly/cCmbgg : Rcpp 0.8.6
>>    |- http://bit.ly/bzoWrs : Rcpp svn revision 2000
>>    `- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th
>>
>>
>>
>>
>>
>> --
>> Alessandro Torrisi
>> Information Technology Consultant
>> Email: alessandro.torrisi at gmail.com <mailto:alessandro.torrisi at gmail.com>
>> Skype: alessandro.torrisi
>> Tel: +39/333/2442546
>>
>> "Questo documento è formato esclusivamente per il destinatario. Tutte le
>> informazioni ivi contenute, compresi eventuali allegati, sono soggette a
>> riservatezza a termini del vigente D.Lgs. 196/2003 in materia di
>> "privacy" e quindi ne è proibita l'utilizzazione. Se avete ricevuto per
>> errore questo messaggio, Vi preghiamo cortesemente di contattare
>> immediatamente il mittente e cancellare la e-mail. Grazie."
>>
>>
>>
>> _______________________________________________
>> 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
> http://romainfrancois.blog.free.fr
> |- http://bit.ly/cCmbgg : Rcpp 0.8.6
> |- http://bit.ly/bzoWrs : Rcpp svn revision 2000
> `- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th
>
>
>


-- 
Alessandro Torrisi
Information Technology Consultant
Email: alessandro.torrisi at gmail.com
Skype: alessandro.torrisi
Tel: +39/333/2442546

"Questo documento è formato esclusivamente per il destinatario. Tutte le
informazioni ivi contenute, compresi eventuali allegati, sono soggette a
riservatezza a termini del vigente D.Lgs. 196/2003 in materia di "privacy" e
quindi ne è proibita l'utilizzazione. Se avete ricevuto per errore questo
messaggio, Vi preghiamo cortesemente di contattare immediatamente il
mittente e cancellare la e-mail. Grazie."



-- 
Alessandro Torrisi
Information Technology Consultant
Email: alessandro.torrisi at gmail.com
Skype: alessandro.torrisi
Tel: +39/333/2442546

"Questo documento è formato esclusivamente per il destinatario. Tutte le
informazioni ivi contenute, compresi eventuali allegati, sono soggette a
riservatezza a termini del vigente D.Lgs. 196/2003 in materia di "privacy" e
quindi ne è proibita l'utilizzazione. Se avete ricevuto per errore questo
messaggio, Vi preghiamo cortesemente di contattare immediatamente il
mittente e cancellare la e-mail. Grazie."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100924/a856258a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: REmbedded.zip
Type: application/zip
Size: 4421 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100924/a856258a/attachment-0001.zip>


More information about the Rcpp-devel mailing list