Building on Windows from scratch

Gary Bilkus mail at gary.bilkus.com
Sat Dec 28 03:16:08 EST 2013


> Nice you got it to compile !
>
> With my local modifications I got stuck in engine/test with this error:
> /bin/sh ../../../libtool --tag=CC   --mode=link gcc -I. -I/c/soft/gnucash.git/src/engine/test -I../../.. -
> I/c/soft/gnucash.git/src/engine/ -DTESTPROG=test_engine -mms-bitfields -
> Ic:/soft/gnome/include/glib-2.0 -Ic:/soft/gnome/lib/glib-2.0/include   -Werror -Wdeclaration-after-
> statement -g  -mms-bitfields -g  -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -
> Wno-unused -no-undefined -L/c/soft/regex/lib -lregex -L/c/soft/gnome/lib -L/c/soft/guile/lib -
> L/c/soft/libdbi/lib -L/c/soft/gwenhywfar/lib -L/c/GCDevel/GC-Maint/hh/lib -L/c/soft/sqlite3/lib -
> L/c/soft/enchant/lib -L/c/soft/libxslt/lib -L/c/soft/mingw/lib -g -o test-engine.exe test_engine-test-
> engine.o test_engine-utest-Account.o test_engine-utest-Budget.o test_engine-utest-Invoice.o
> libutest-Split.la libutest-Trans.la ../../../src/libqof/qof/libgnc-qof.la ../../../src/gnc-module/libgnc-
> module.la ../../../src/test-core/libtest-core.la ../libgncmod-engine.la ../test-core/libgncmod-test-
> engine.la ../../../src/core-utils/libgnc-core-utils.la -Lc:/soft/gnome/lib -lgio-2.0 -lgobject-2.0 -
> lgthread-2.0 -lgmodule-2.0 -lglib-2.0 -lintl   -lm
> libtool: link: gcc -I. -I/c/soft/gnucash.git/src/engine/test -I../../.. -I/c/soft/gnucash.git/src/engine/ -
> DTESTPROG=test_engine -mms-bitfields -Ic:/soft/gnome/include/glib-2.0 -
> Ic:/soft/gnome/lib/glib-2.0/include -Werror -Wdeclaration-after-statement -g -mms-bitfields -g -
> Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -g -o .libs/test-
> engine.exe test_engine-test-engine.o test_engine-utest-Account.o test_engine-utest-Budget.o
> test_engine-utest-Invoice.o  -L/c/soft/regex/lib -L/c/soft/gnome/lib -L/c/soft/guile/lib -
> L/c/soft/libdbi/lib -L/c/soft/gwenhywfar/lib -L/c/GCDevel/GC-Maint/hh/lib -L/c/soft/sqlite3/lib -
> L/c/soft/enchant/lib -L/c/soft/libxslt/lib -L/c/soft/mingw/lib ./.libs/libutest-Split.a -
> Lc:/soft/gnome/lib -Lc:/soft/guile/lib -L/c/soft/readline/lib ./.libs/libutest-Trans.a
> /c/soft/gnucash/build/src/test-core/.libs/libtest-core.a ../../../src/libqof/qof/.libs/libgnc-qof.dll.a
> ../../../src/gnc-module/.libs/libgnc-module.dll.a ../../../src/test-core/.libs/libtest-core.a
> ../.libs/libgncmod-engine.a ../test-core/.libs/libgncmod-test-engine.a
> /c/soft/gnucash/build/src/engine/.libs/libgncmod-engine.a /c/soft/gnucash/build/src/gnc-
> module/.libs/libgnc-module.dll.a /c/soft/gnucash/build/src/core-utils/.libs/libgnc-core-utils.dll.a
> ../../../src/core-utils/.libs/libgnc-core-utils.dll.a c:/soft/guile/lib/libguile.dll.a -lgmp -lws2_32
> /mingw/lib/libltdl.dll.a -lpthread /c/soft/gnucash/build/src/libqof/qof/.libs/libgnc-qof.dll.a -lregex -
> lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 /mingw/lib/libintl.dll.a
> /mingw/lib/libiconv.dll.a -pthread -Lc:/soft/gnucash/inst/lib -Lc:/soft/guile/lib -L/mingw/lib
> ../.libs/libgncmod-engine.a(Transaction.o):Transaction.c:(.data+0x10): multiple definition of
> `trans_is_closing_str'
> ./.libs/libutest-Trans.a(utest-Transaction.o):utest-Transaction.c:(.data+0x14): first defined here
> collect2.exe: error: ld returned 1 exit status
>
>
>> The only other source file issue is in
>> gnome-gnc-split-reg.h
>> where we get the error: expected identifier before numeric constant
>> DELETE, A bit of trial and error got this to go away by adding
>> #undef DELETE
>> #undef DUPLICATE
>> on line 116, but to be honest I'm not entirely sure what's going on
>> here yet.
>>
>> After all that, a make followed by make install seems to complete,
>> although with lots of
>> libtool: link: warning : 'c/soft/mongw/lib/lib.....la seems to be
>> moved warnings coming up.
>>
> As Derek already said: this is a normal warning which you can ignore.
>
>> Unfortunately, after all that, I can't get it to run.
>> If I try to start it from /c/soft/gnucash/inst/bin there are lots of
>> missing dlls, which all appear to be dotted around in other places.
>> If I copy everything into a single directory and try to run I get
>> Error: Unspecified fatal error encountered, aborting.....
>>
> The problem here is that most of the dependencies are not installed in one single location
> accessible from the Windows path.
>
> This installation scheme has been chosen for the lack of a package management system in
> mingw/Windows. Having each dependency in a separate directory makes it very easy to renew
> a dependency: simply delete the existing directory and run the build again.
>
> There is a way to run gnucash from the install directory though: you have to include all the bin
> directories of all the dependencies in either the Windows or the MSYS PATH variable. The easiest
> is write a simple batch script for this. We used to have one, which I deleted at some point (way
> too early unfortunately).
>
> My intention is to restore the ability to run gnucash directly from the installation directory. I'm
> not sure how though. Instead of requiring a batch file to set up the environment, I'd rather
> figure out a way to better manage the dependencies together in one location. I'm not sure how
> yet. Either leverage the mingw package manager in some way or do improve the installation
> script to be a bit smarter (leverage make install and make uninstall, using the same prefix for all
> dependencies)... That part is still fuzzy.
>
> My longer term goal is even more ambitious: I would like to eventually get to the point where
> you don't need to run install.sh for each minor change. But instead use make as it was intended.
> With that I mean: if you change one file in the engine subdirectory a simple make && make
> install in that directory should be all that's needed, not running install.sh on the whole project.
> You can achieve this now already by manually tweaking the build environment but I'd like that
> way of working to become the default. Install.sh should only be run to update dependencies.
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Thanks Geert,
I've got a bit further....the program now starts and then dies after 
showing a splash screen.
I found a gnucash-launcher.cmd script which didn't quite work, because 
it was missing references to libxslt enchant and libsoup
If I add those ( bin and lib ) to the path, the program no longer 
complains, but dies almost immediately.
If I run inside gdb, it seems to be failing somewhere in guile 
initialization which causes the program to exit.

I've also set up an XP VM and run on there under 32 bits, just to see 
what happens. Same thing - it will compile OK, and dies at the same point.
My next stage will be to recompile guile and leave the tmp directory 
around, so that gdb has source to work from, and see if a detailed debug 
session shows up the problem. Unless you have a better idea!
Gary





More information about the gnucash-devel mailing list