Announcing a new sub-project in gnucash: GUI in C++, Qt, CMake.

Herbert Thoma herbert.thoma at iis.fraunhofer.de
Fri Mar 5 07:48:47 EST 2010


Some more experiments:

Qt 4.4.0 is not sufficient because it does not provide QSharedPointer,
so I installed Qt 4.6.2 and I inserted a #define HAVE_GUILE18 in
src/engine/engine-helpers.c. This way everything compiles but the very
final main.cpp.

I do not really understand the error:

[ 99%] Building CXX object src/gnc/CMakeFiles/cutecash.dir/main.cpp.o
In file included from /usr/include/c++/4.3/iosfwd:46,
                 from /usr/include/gmp.h:24,
                 from /usr/include/libguile.h:24,
                 from /home/tma/gnucash/gnucash_cvs/cutecash/src/gnc/main.cpp:31:
/usr/include/c++/4.3/bits/stringfwd.h:48: error: template with C linkage
/usr/include/c++/4.3/bits/stringfwd.h:51: error: template with C linkage
/usr/include/c++/4.3/bits/stringfwd.h:54: error: template with C linkage
/usr/include/c++/4.3/bits/stringfwd.h:58: error: template specialization with C linkage
/usr/include/c++/4.3/bits/stringfwd.h:63: error: template specialization with C linkage
In file included from /usr/include/c++/4.3/iosfwd:47,
                 from /usr/include/gmp.h:24,
                 from /usr/include/libguile.h:24,
                 from /home/tma/gnucash/gnucash_cvs/cutecash/src/gnc/main.cpp:31:
/usr/include/c++/4.3/bits/postypes.h:90: error: template with C linkage
/usr/include/c++/4.3/bits/postypes.h:193: error: template with C linkage
/usr/include/c++/4.3/bits/postypes.h:198: error: template with C linkage
In file included from /usr/include/gmp.h:24,
                 from /usr/include/libguile.h:24,
                 from /home/tma/gnucash/gnucash_cvs/cutecash/src/gnc/main.cpp:31:
/usr/include/c++/4.3/iosfwd:51: error: template with C linkage
/usr/include/c++/4.3/iosfwd:54: error: template with C linkage
/usr/include/c++/4.3/iosfwd:57: error: template with C linkage
/usr/include/c++/4.3/iosfwd:60: error: template with C linkage
/usr/include/c++/4.3/iosfwd:63: error: template with C linkage
/usr/include/c++/4.3/iosfwd:66: error: template with C linkage
/usr/include/c++/4.3/iosfwd:70: error: template with C linkage
/usr/include/c++/4.3/iosfwd:74: error: template with C linkage
/usr/include/c++/4.3/iosfwd:78: error: template with C linkage
/usr/include/c++/4.3/iosfwd:82: error: template with C linkage
/usr/include/c++/4.3/iosfwd:85: error: template with C linkage
/usr/include/c++/4.3/iosfwd:88: error: template with C linkage
/usr/include/c++/4.3/iosfwd:91: error: template with C linkage
/usr/include/c++/4.3/iosfwd:94: error: template with C linkage
/usr/include/c++/4.3/iosfwd:97: error: template with C linkage
In file included from /usr/include/libguile.h:24,
                 from /home/tma/gnucash/gnucash_cvs/cutecash/src/gnc/main.cpp:31:
/usr/include/gmp.h:2136: error: declaration of C function ‘std::ostream& operator<<(std::ostream&, const __mpq_struct*)’ conflicts with
/usr/include/gmp.h:2135: error: previous declaration ‘std::ostream& operator<<(std::ostream&, const __mpz_struct*)’ here
/usr/include/gmp.h:2137: error: declaration of C function ‘std::ostream& operator<<(std::ostream&, const __mpf_struct*)’ conflicts with
/usr/include/gmp.h:2136: error: previous declaration ‘std::ostream& operator<<(std::ostream&, const __mpq_struct*)’ here
/usr/include/gmp.h:2139: error: declaration of C function ‘std::istream& operator>>(std::istream&, __mpq_struct*)’ conflicts with
/usr/include/gmp.h:2138: error: previous declaration ‘std::istream& operator>>(std::istream&, __mpz_struct*)’ here
/usr/include/gmp.h:2140: error: declaration of C function ‘std::istream& operator>>(std::istream&, __mpf_struct*)’ conflicts with
/usr/include/gmp.h:2139: error: previous declaration ‘std::istream& operator>>(std::istream&, __mpq_struct*)’ here
make[2]: *** [src/gnc/CMakeFiles/cutecash.dir/main.cpp.o] Fehler 1
make[1]: *** [src/gnc/CMakeFiles/cutecash.dir/all] Fehler 2
make: *** [all] Fehler 2

 Herbert.

Herbert Thoma schrieb:
> Hi Christian,
> 
> cool project! I tried to build cutecash and ran into some problems:
> 
> I run SuSE 11.0 on this computer. SuSE 11.0 is not so old, however, it
> lacks your required minimum versions of glib and Qt.
> You require glib (and gobject, gmodule, gthread) 2.20.0 but GnuCash
> only requires 2.12.0.
> You require Qt 4.5.0 but I have only 4.4.0.
> I changed the minimum requirements in CMakeLists.txt to glib 2.12.0
> and Qt 4.4.0 and cmake completed successfully.
> 
> Compiling fails with the following error:
> [ 62%] Building C object src/engine/CMakeFiles/engine.dir/engine-helpers.c.o
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c: In function ‘gnc_query2scm’:
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c:1712: error: ‘scm_block_gc’ undeclared (first use in this function)
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c:1712: error: (Each undeclared identifier is reported only once
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c:1712: error: for each function it appears in.)
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c: In function ‘gnc_scm2query_v2’:
> /home/tma/gnucash/gnucash_cvs/cutecash/src/engine/engine-helpers.c:2013: error: ‘scm_block_gc’ undeclared (first use in this function)
> make[2]: *** [src/engine/CMakeFiles/engine.dir/engine-helpers.c.o] Fehler 1
> make[1]: *** [src/engine/CMakeFiles/engine.dir/all] Fehler 2
> make: *** [all] Fehler 2
> 
> The problem are some section like this:
> #ifndef HAVE_GUILE18
>     --scm_block_gc;
> #endif
> in src/engine/engine-helpers.c
> 
> Do you know how to check for the guile version and how to set the HAVE_GUILE18 if required
> in cmake?
> 
> Keep up this interesting work!
> 
>  Herbert.
> 
> Christian Stimming schrieb:
>> I'd like to explain my recent experiments with C++ and cmake: I was tired of 
>> the amount of code one has to write in the C language to achieve seemingly 
>> trivial tasks. In my day-time projects with other, more GUI-suited, 
>> programming languages, the simple tasks can be written sooo much simpler, 
>> leaving much more time for the actual challenging tasks. In gnucash, over and 
>> over again I thought couldn't the GUI be written in any of the more modern 
>> languages and/or toolkits. I mean, can we get the fun into gnucash coding 
>> again?
>>
>> Actually, we can.
>>
>> Announcing a new sub-project in gnucash: The non-GUI parts are re-used in the 
>> state they are, in the C language. This means the double-entry principles and 
>> all of the other achievments in the "engine" and xml-backend and eventually 
>> other backends can be re-used. But the GUI is rewritten completely new, from 
>> scratch, in C++ and using the Qt toolkit. Fun again. The build system is CMake 
>> because its configuration runs magnitudes faster. Fun again. And as a final 
>> bonus, for MS windows more compiler than before are supported, namely this 
>> whole new project can be compiled by MS Visual Studio as well. So here it is:
>>
>>   Cutecash
>>   Free Finance Software. Easy to develop, easy to use.
>>
>> Currently this is only a proof-of-concept for developers: You can load an 
>> existing gnucash XML file, and it will show the list of accounts as a flat 
>> table in a QTableView. The fun part is how easy it was to add this display of 
>> all accounts, so it will probably take only another 1-2 hours until the 
>> account list is a tree to be viewed in a QTreeView. And a QTableView with the 
>> splits of an account can't be far...
>>
>> To give this a try, have qt4 (>=4.5.0) and cmake (>= 2.6.0) installed and:
>>
>>   mkdir build-cutecash
>>   cd build-cutecash
>>   cmake ..
>>   make
>>   ./src/gnc/cutecash
>>
>> Have fun (again)!
>>
>> Christian
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>
> 

-- 
Herbert Thoma
Dipl.-Ing., MBA
Head of Video Group
Multimedia Realtime Systems Department
Fraunhofer IIS
Am Wolfsmantel 33, 91058 Erlangen, Germany
Phone: +49-9131-776-6130
Fax:   +49-9131-776-6099
email: tma at iis.fhg.de
www: http://www.iis.fhg.de/


More information about the gnucash-devel mailing list