[Rcpp-devel] finding an undefined symbol

Andrew Redd amredd at gmail.com
Thu Nov 4 21:40:24 CET 2010


Figured it out.  The definition for data3 is in a namespace, so it
could not find the member functions.
-Andrew

On Thu, Nov 4, 2010 at 2:26 PM, Andrew Redd <amredd at gmail.com> wrote:
> Thanks for the post.  The data3 class is defined with
> ---
> #include <Rcpp.h>
> #include "types.h" //defines ivec, tvec, idxvec, as vectors and
> numeric as double
> class data3{
> public:
> data3();
> void initPat(tvec, tvec);
> void initAug(ivec, ivec, tvec);
> void initSwabs(idxvec, ivec, tvec);
> void setParameters(numeric, numeric, numeric);
> numeric augmentedLogLikelihood();
> numeric dataLogLikelihood();
> };
> RCPP_MODULE(GPU_BAYES){
> using namespace Rcpp;
> class_<data3>("data3")
> .method("initPat",&data3::initPat)
> .method("initAug",&data3::initAug)
> .method("initSwabs",&data3::initSwabs)
> .method("setParameters", &data3::setParameters);
> }
> ---
> There is no initSwabs with only one parameter, is that what this is looking for?
>
> -Andrew
>
>
>
>
> On Thu, Nov 4, 2010 at 8:44 AM, Douglas Bates <bates at stat.wisc.edu> wrote:
>>
>> On Wed, Nov 3, 2010 at 2:22 PM, Andrew Redd <amredd at gmail.com> wrote:
>> > I'm writing a rather complicated package using CUDA and Rcpp.  I have
>> > everything compile and link ok, but when loading I get a
>> >> "unable to load shared object ..."
>> >> "... undefined symbol:  _ZN5data39initSwabsESt6vector..."
>> > Does anyone have any advice how to fix this and/or figure out what exactly
>> > the problem is?
>>
>> First you need to demangle the name.  On Linux systems there is a
>> utility called c++filt which, for this symbol shows
>>
>> $ echo _ZN5data39initSwabsESt6vector | c++filt
>> data3::initSwabs(std::vector)
>>
>> The most likely cause of the problem is that you have the CUDA package
>> headers in the -I list when you compile but not the library in the -L
>> list when linking.
>


More information about the Rcpp-devel mailing list