0.7.12 laesst sich nicht compilen.
Compiler:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-linux-gnu/4.9/lto-wrapper
Target: i586-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.1-4' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --with-arch-32=i586 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i586-linux-gnu --host=i586-linux-gnu --target=i586-linux-gnu
Thread model: posix
gcc version 4.9.1 (Debian 4.9.1-4)
Make-Fehler:
make[3]: Entering directory '/home/mmolle/Downloads/FreeDoko/FreeDoko_0.7.12/src/ui/gtkmm'
g++ -c ./ui/gtkmm/utils.cpp
In file included from utils.cpp:29:0:
/usr/include/glibmm-2.4/glibmm/variantdict.h: In member function ‘bool Glib::VariantDict::lookup_value(const Glib::ustring&, T_Value&) const’:
constants.h:43:12: error: cannot declare pointer to ‘const class std::bad_cast&’
#define ex * 12
^
/usr/include/glibmm-2.4/glibmm/variantdict.h:226:30: note: in expansion of macro ‘ex’
catch(const std::bad_cast& ex)
^
constants.h:43:14: error: expected ‘)’ before numeric constant
#define ex * 12
^
/usr/include/glibmm-2.4/glibmm/variantdict.h:226:30: note: in expansion of macro ‘ex’
catch(const std::bad_cast& ex)
^
constants.h:43:14: error: expected ‘{’ before numeric constant
#define ex * 12
^
/usr/include/glibmm-2.4/glibmm/variantdict.h:226:30: note: in expansion of macro ‘ex’
catch(const std::bad_cast& ex)
^
In file included from /usr/include/glibmm-2.4/glibmm.h:145:0,
from constants.h:57,
from utils.cpp:29:
/usr/include/glibmm-2.4/glibmm/variantdict.h:226:32: error: expected ‘;’ before ‘)’ token
catch(const std::bad_cast& ex)
^
../../Makefile.rules:85: recipe for target 'utils.o' failed
make[3]: *** [utils.o] Error 1
make[3]: Leaving directory '/home/mmolle/Downloads/FreeDoko/FreeDoko_0.7.12/src/ui/gtkmm'
../Makefile.rules:99: recipe for target 'gtkmm' failed
make[2]: *** [gtkmm] Error 2
make[2]: Leaving directory '/home/mmolle/Downloads/FreeDoko/FreeDoko_0.7.12/src/ui'
Makefile.rules:99: recipe for target 'ui' failed
make[1]: *** [ui] Error 2
make[1]: Leaving directory '/home/mmolle/Downloads/FreeDoko/FreeDoko_0.7.12/src'
Makefile:81: recipe for target 'compile' failed
make: *** [compile] Error 2
svn version funktioniert.
Version: 0.7.13 (alpha)
Date: 2014-08-28
Some other header seems to have defined ex as a C macro. Using such a short and lower-case name for a macro is a bad idea because it causes exactly this kind of problem. You'll need to find out what header is doing that and try to fix it.
If necessary, you might work around it by doing
#undef ex
Last edit: Murray Cumming 2014-09-23
ex ist in mehreren Header-Datieen der gtkmm-Bibliothek als Variablename verwendet. In FreeDoko ist ex als "* 12" definiert, daraus resultiert der Fehler. ein #undef ex funktioniert daher nicht.
Die jetzige Vorgehensweise ist schlechter Stil, dies ist im svn bereits korrigiert. Die Bezeichnung kommt von LaTeX und gibt quasi eine Zeilenhöhe an. Leider kenne ich in gtk keine Möglichkeit, die Höhe eine Textzeile dynamisch zu ermitteln.
https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-get-size
https://developer.gnome.org/pango/stable/pango-Glyph-Storage.html#pango-extents-to-pixels
https://developer.gnome.org/pango/stable/pango-Glyph-Storage.html#pango-glyph-string-extents
this should help computing the size of a rendered string
greets
mo
On 23. September 2014 22:20:35 MESZ, "Dr. Diether Knof" dknof@users.sf.net wrote:
Related
Bugs:
#325Here's some gtkmm code that I use in Glom to get the width of some text. Maybe it's a useful clue:
https://git.gnome.org/browse/glom/tree/glom/utils_ui.cc#n296
Ich habe das Makro in EX umbenannt. Die feste Größe lasse ich erst einmal drin, solange es keine Darstellungsprobleme gibt.