<#part sign=pgpmime> On Tue, 6 Mar 2012 19:05:47 +0100, Sqoox85 <[email protected]> wrote: > typedef struct _cuobject cuObject; > > //pointers to function > typedef int (*comparefunc)(const cuObject*, const cuObject*, int); > > > typedef struct _cutype{ > comparefunc compare; > } cuType; > > __host__ __device__ int object_compare(const cuObject* a, const > cuObject* b, int op){ > return -1; > } > > > typedef struct _cuobject{ > static cuType* type; > > __host__ __device__ _cuobject(){ > //type = NULL; > if(type == NULL){ > > cuType cuobjecttype = { > object_compare, > }; > type = &cuobjecttype; > } > } > } cuObject; > > int main(){ > cuObject c; > } > > > I didn't put all the code but only the main part. > The error correspond to the line "if(type==NULL)": > test.cu(79): error: identifier "_ZN9_cuobject4typeE" is undefined > > Seems that the compiler doesn't see the static pointer.
No, that's a C++ fail on your part. :) You need a definition of that static member outside of the class. Andreas _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
