2002-10-16 19:04:44 +04:00
|
|
|
test11-modglobalconstr
|
|
|
|
|
|
|
|
This is the description from test10-modvirtual:
|
|
|
|
> Create an interface class in modules.h called DeviceInterface. Each module
|
|
|
|
> creates a child class of DeviceInterface, and implements its methods. This
|
|
|
|
> test loads the modules, calls the module's module_init() which instantiates a
|
|
|
|
> subclass of DeviceInterface and returns a pointer to it. Then main can
|
|
|
|
> operate on this object using the DeviceInterface class.
|
|
|
|
|
|
|
|
In test11, I have changed only one thing. Module2's class is created
|
2002-10-17 04:33:50 +04:00
|
|
|
by a global constructor. Global constructors SHOULD be called when
|
2002-10-16 19:04:44 +04:00
|
|
|
the module loads, but if your C++ compile/link process is broken or
|
2002-10-17 04:33:50 +04:00
|
|
|
libtool uses the wrong link args, then sometimes global constructors in
|
|
|
|
shared libs are NOT loaded.
|
2002-10-16 19:04:44 +04:00
|
|
|
|
|
|
|
If test10 succeeds, but test11 fails, then you will know that your
|
|
|
|
platform does not call global constructors on shared libraries
|
|
|
|
when they are loaded.
|