GnuCash on Windows -- about to become true!

Christian Stimming stimming at tuhh.de
Sun Sep 3 06:04:57 EDT 2006


Forgot to add yet one more remark:

Am Samstag, 2. September 2006 21:41 schrieb Christian Stimming:
> > Before I got this far, I needed to tweak more things that aren't yet
> > included in the installer:

With the unchanged SVN source code, GnuCash on windows will always terminate 
at gnucash-bin.c:377 because the function gnc_engine_is_initialized() returns 
false, i.e. it claims the static variable engine_is_initialized in 
src/engine/gnc-engine.c were still zero. 

After I added a bunch of printf's to gnc_engine_init() I saw that 
gnc_engine_init() in fact runs quite successfully. In particular, the 
variable engine_is_initialized is indeed set to one at gnc-engine.c:114 even 
on Windows, i.e. the (required) file backend is loaded successfully. 
Nevertheless, when gnucash-bin.c calls gnc_engine_is_initialized(), the 
function sees a variable engine_is_initialized that is still zero. From what 
I understand here, this points to a much more fundamental problem: Obviously 
more than one instance of this static variable exists! 

I could guess one instance exists due to the compile/linking-time linking of 
libgncmod-engine to gnucash.exe, and a different instance exists due to the 
runtime loading of libgncmod-engine. And the first one is used when 
gnucash-bin.c calls gnc_engine_is_initialized() (because that function call 
is resolved to the compile/linking-time DLL), whereas the second instance is 
used when gnc_engine_init() is called, which is not called from within 
gnucash-bin.c but from somewhere else, most probably  
libgncmod_engine_LTX_gnc_module_init() in gncmod-engine.c.

As a workaround, I commented out the call to gnc_engine_is_initialized() in 
gnucash-bin.c, and that at least gave the correct main window. But of course 
a fundamental solution is needed for this issue of potentially duplicated 
static variables. Unfortunately I don't quite know how this could be fixed.

Christian


More information about the gnucash-devel mailing list