In order to allow dynamic loading of stratego apps, init-stratego-application.h should include a non-static initialization function. Adding this function should be sufficient:

void SRTS_dynload_stratego_initialize_module()
{
init_module_constructors();
init_module_constant_terms();
}

(or, alternatively, just copy the one from stratego-dl: https://svn.cs.uu.nl:12443/repos/StrategoXT/trunk/stratego-dl/src/include/srts/init-stratego-application.h)

Submitted on 25 July 2005 at 10:05

On 12 December 2005 at 15:07 Jira commented:

STR-363, martin:
This might result in all kinds of linking problems (duplicate symbols), so I don’t know if this is a very good solution. In the Stratego Shell, I used a quick hack to get a reference to the initialization function (but there might even be more than 1!) by setting the variable “SRTS_stratego_initialize” to NULL before loading the library, the default constructors of the module create a fresh linked list of initializers, that can be invoked after loading the module.


On 28 January 2013 at 14:46 Eelco Visser removed tag 0.18M1

On 28 January 2013 at 14:46 Eelco Visser tagged interesting

Log in to post comments