Game Development Community

Unreferenced Objects Stripped from Static libs

by William Todd Scott · in Torque Game Engine Advanced · 10/19/2007 (1:11 pm) · 1 replies

Hi,

I thought that, given the direction Torque 2 is headed, someone here might have come up with an elegant solution to the following problem...

ConsoleObjects register themselves with a factory so that objects not referenced in C++ can be created and used from script. This poses an interesting problem when you try to break the engine down into static libraries. Specifically, ComponentObjects that are not directly referenced in the C++ of the executable, will be stripped out during linking.

The only solution I am aware of is to create each object somewhere in the exe. This is a bummer because we have to remember that for EVERY new object that is created in the library, we need to new it or something in the exe.

Is anyone aware of a better solution to this issue?

Todd

#1
10/20/2007 (10:34 am)
We had an interesting thread about this topic on sweng-gamedev if anyone is interested.

The conclusion (to me) was to use explicit initialization.

Todd