+namespace {
+
+int const xforms_include_version = FL_INCLUDE_VERSION;
+
+} // namespace anon
+
+
+int GUIRunTime::initApplication(int , char **)
+{
+ // Check the XForms version in the forms.h header against
+ // the one in the libforms. If they don't match quit the
+ // execution of LyX. Better with a clean fast exit than
+ // a strange segfault later.
+ // I realize that this check have to be moved when we
+ // support several toolkits, but IMO all the toolkits
+ // should try to have the same kind of check. This could
+ // be done by having a CheckHeaderAndLib function in
+ // all the toolkit implementations, this function is
+ // responsible for notifing the user.
+ // if (!CheckHeaderAndLib()) {
+ // // header vs. lib version failed
+ // return 1;
+ // }
+ int xforms_lib_version = fl_library_version(0, 0);
+ if (xforms_include_version != xforms_lib_version) {
+ lyxerr << "You are either running LyX with wrong "
+ "version of a dynamic XForms library\n"
+ "or you have build LyX with conflicting header "
+ "and library (different\n"
+ "versions of XForms. Sorry but there is no point "
+ "in continuing executing LyX!" << endl;
+ return 1;
+ }
+ return 0;
+}
+