You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If no variable or function is odr-used from a given translation unit, the non-local variables defined in that translation unit may never be initialized (this models the behavior of an on-demand dynamic library). However, as long as anything from a translation unit is odr-used, all non-local variables whose initialization or destruction has side effects will be initialized even if they are not used in the program.
Since the generated C++ files do not contain any variable or function that is odr-used this means that the compiler is free not to initialise the factory instance and so that factory doesn't get registered and souffle::ProgramFactory::newInstance fails to find the program.
The text was updated successfully, but these errors were encountered:
Indeed, I ran into this issue when linking the generated C++ file with a Rust program. At first I thought it was a Rust issue but they pointed out that this behaviour is allowed by the C++ standard.
The C++ standard says that:
https://en.cppreference.com/w/cpp/language/initialization#Deferred_dynamic_initialization
Since the generated C++ files do not contain any variable or function that is odr-used this means that the compiler is free not to initialise the factory instance and so that factory doesn't get registered and
souffle::ProgramFactory::newInstance
fails to find the program.The text was updated successfully, but these errors were encountered: