Hi,
On Wed, 2009-02-11 at 16:29 -0600, Patrick Hartling wrote:
> Marcus Lindblom wrote:
> > Patrick Hartling wrote:
> >> I have made some big progress in getting PyOpenSG updated to the OpenSG
> >> 2.0 trunk, but I have run up against problems related to class templates
> >> with static data members.
> >
> > [snip]
> >
> >> My hope is that this can be fixed
> >> with a GCC compiler option or something that is similarly non-invasive
> >> to the OpenSG code in question. Does anyone have any ideas or
> >> suggestions about how this can be resolved?
> >
> > Have you tried the python-c++ list? It's hard to think you're the first
> > one to encounter this.
> >
> > Just offer something: On Windows, you can tell the compiler that a
> > certain template instantiation is to be exported from a dynamic library.
> > I don't know if something similar is possible with GCC, but I've heard
> > rumours lately about explicit export and automatic hiding there.
>
> No, I hadn't asked there yet. I was just about to send them a message when I
> tried something that seems to resolve things in a fairly clean manner. If I
> modify the class declaration to be the following, things appear to be
> working for me:
>
> template<typename T>
> class C
> {
> public:
> // Leave initialization here.
> static const int static_member = 0;
> };
>
> // Add static data member definition statement;
> template<typename T> const int C<T>::static_member;
>
> If I hadn't been so focused on the full type instantiation, I might have
> tried this sooner. I am running a build right now to test this.
just a little curious, how do you handle this in general. None of the
FieldMask/FieldId elements has a definition so you actually can't take
the address of any of them, e.g
fprintf(stderr, "%p\n", &Transform::MatrixFieldMask);
fails as well.
So there must be something somewhere that solves this for regular
classes and before adding definitions to the templates part (as your
patch does) I would like to have a short look there.
kind regards
gerrit
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users