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.

  -Patrick


-- 
Patrick L. Hartling
Senior Software Engineer, Priority 5
http://www.priority5.com/

The information transmitted in this communication is intended only for
the person or entity to which it is addressed and contains proprietary
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please destroy any copies, contact the sender
and delete the material from any computer.

------------------------------------------------------------------------------
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

Reply via email to