[SOLVED] Unable to compile GIT verion with freetype-2.5.4
Moderator: Oberlus
[SOLVED] Unable to compile GIT verion with freetype-2.5.4
Hello.
I use Gentoo 64bit and tried to build current (today) version with two versions of freetype - 2.5.3-r1 and 2.5.4-r1.
And I can't finish compilation with freetype-2.5.4. But with freetype-2.5.3 everything compiles okay. Something need to edit in sources. Compiler prints compilation error on ./GG/src/Font.cpp with freetype-2.5.4-r1.
I congratulate on the coming New Year of all project participants from developers to fans of the game.
Sorry for my boozy english )) please.
I use Gentoo 64bit and tried to build current (today) version with two versions of freetype - 2.5.3-r1 and 2.5.4-r1.
And I can't finish compilation with freetype-2.5.4. But with freetype-2.5.3 everything compiles okay. Something need to edit in sources. Compiler prints compilation error on ./GG/src/Font.cpp with freetype-2.5.4-r1.
I congratulate on the coming New Year of all project participants from developers to fans of the game.
Sorry for my boozy english )) please.
Last edited by asm64 on Tue Dec 30, 2014 3:46 pm, edited 1 time in total.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Unable to compile GIT verion with freetype-2.5.4
Which is?asm64 wrote:Compiler prints compilation error on ./GG/src/Font.cpp with freetype-2.5.4-r1.
Re: Unable to compile GIT verion with freetype-2.5.4
first error is:Geoff the Medio wrote:Which is?
Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1514:29: error: ambiguous overload for 'operator+' (operand types are 'GG::X' and 'const unsigned int')
if (Value(x + glyph_bitmap.width) >= TEX_MAX_SIZE) { // start a new row of glyph images
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1514:29: note: candidates are:
In file included from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/PtRect.h:32:0,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/Base.h:56,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/AlignmentFlags.h:32,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/Font.h:35,
from /home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:25:
/home/pvv/GIT/freeorion/FreeOrion/GG/GG/StrongTypedef.h:120:22: note: GG::X GG::operator+(GG::X, int)
inline self_type operator op (self_type lhs, rhs_type rhs) \
then next error:
Code: Select all
GG/src/CMakeFiles/GiGi.dir/build.make:330: recipe for target 'GG/src/CMakeFiles/GiGi.dir/Font.cpp.o' failed
make[2]: *** [GG/src/CMakeFiles/GiGi.dir/Font.cpp.o] Error 1
Code: Select all
CMakeFiles/Makefile2:127: recipe for target 'GG/src/CMakeFiles/GiGi.dir/all' failed
make[1]: *** [GG/src/CMakeFiles/GiGi.dir/all] Error 2
Code: Select all
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
- Attachments
-
- freeorion-freetype-2.5.4-build-error.log
- build log with freetype-2.5.4
- (57.84 KiB) Downloaded 190 times
Re: Unable to compile GIT verion with freetype-2.5.4
I may help with test of a patch.
Re: Unable to compile GIT verion with freetype-2.5.4
I guess our Linux folks will have to look into that one...
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Unable to compile GIT verion with freetype-2.5.4
Since you didn't list all the errors, I can't make a comprehensive patch, but the necessary changes should probably be something likeTry making similar changes at every line the produces the error.
Code: Select all
Index: GG/src/Font.cpp
===================================================================
--- GG/src/Font.cpp (revision 7806)
+++ GG/src/Font.cpp (working copy)
@@ -1511,12 +1511,12 @@
ThrowBadGlyph("GG::Font::Init : Glyph too large for buffer'%1%'", c); // catch broken fonts
}
- if (Value(x + glyph_bitmap.width) >= TEX_MAX_SIZE) { // start a new row of glyph images
+ if (Value(x) + glyph_bitmap.width >= TEX_MAX_SIZE) { // start a new row of glyph images
if (x > max_x) max_x = x;
x = X0;
y = max_y;
}
- if (Value(y + glyph_bitmap.rows) >= TEX_MAX_SIZE) {
+ if (Value(y) + glyph_bitmap.rows >= TEX_MAX_SIZE) {
// We cannot make the texture any larger. The font does not fit.
ThrowBadGlyph("GG::Font::Init : Face too large for buffer. First glyph to no longer fit: '%1%'", c);
}
Re: Unable to compile GIT verion with freetype-2.5.4
Um, he did attach the full buildlog.Geoff the Medio wrote:Since you didn't list all the errors
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Unable to compile GIT verion with freetype-2.5.4
Hrm. OK / sorry. In that case, since I can't test it, please try making similar changes on all lines with similar errors and see if it fixes them.Vezzra wrote:Um, he did attach the full buildlog.
Re: Unable to compile GIT verion with freetype-2.5.4
Ok. I'm try to compile with changes. I don't understand what type of GG:Y?
UPS.. I think max_y must be Value(max_y)
wait please. I will try
Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1523:50: error: ambiguous overload for 'operator>' (operand types are 'unsigned int' and 'GG::Y')
if (Value(y) + glyph_bitmap.rows > max_y) {
^
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1523:50: note: candidates are:
In file included from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/PtRect.h:32:0,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/Base.h:56,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/AlignmentFlags.h:32,
from /home/pvv/GIT/freeorion/FreeOrion/GG/GG/Font.h:35,
from /home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:25:
/home/pvv/GIT/freeorion/FreeOrion/GG/GG/StrongTypedef.h:170:17: note: bool GG::operator>(int, GG::Y)
inline bool operator>(lhs_type x, self_type y) \
wait please. I will try
Last edited by asm64 on Mon Dec 29, 2014 6:59 pm, edited 1 time in total.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Unable to compile GIT verion with freetype-2.5.4
I don't understand your question... are you asking what GG::Y is? It's a typedef of int.asm64 wrote:I don't understand what type of GG:Y?
Try wrapping max_y in Value() as well.Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1523:50: error: ambiguous overload for 'operator>' (operand types are 'unsigned int' and 'GG::Y') if (Value(y) + glyph_bitmap.rows > max_y) {
In my ftimage.h, FT_Bitmap::rows and FT_Bitmap::width are int, and the comparisons should apparently work fine. Perhaps it's changed in the latest FreeType to unsigned int so that it can't do the comparison / automatic conversion? Dunno, but wrapping in Value() should get back the int value of the GG::Y or GG::X variables so the compiler is happy and the comparison can be done. If that doesn't work, try static_cast<int>(glyph_bitmap.rows)
Re: Unable to compile GIT verion with freetype-2.5.4
Ok, previous error was solved, but we have several another errors. I wrote in C++ but I weak in it.
I think here it is necessary to perform the reverse conversion and I dont know how to do it.. (cuint -> GG:Y)
Here I tried replace x to Value(x) but problem in buffer.at. Here we need do something with glyph_bitmap.*
And here is the same throube. We need glyph_bitmap.* variables conversation.
Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1524:31: error: ambiguous overload for 'operator+' (operand types are 'GG::Y' and 'const unsigned int')
max_y = y + glyph_bitmap.rows +1; //Leave a one pixel gap between glyphs
...
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1552:19: error: ambiguous overload for 'operator+=' (operand types are 'GG::X' and 'unsigned int')
x += glyph_bitmap.width + 1; //Leave a one pixel gap between glyphs
Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1529:29: error: ambiguous overload for 'operator+' (operand types are 'GG::X' and 'const unsigned int')
buffer.at(x + glyph_bitmap.width, y + glyph_bitmap.rows) = 0;
Code: Select all
/home/pvv/GIT/freeorion/FreeOrion/GG/src/Font.cpp:1546:50: error: ambiguous overload for 'operator+' (operand types are 'GG::X' and 'const unsigned int')
TempGlyphData(Pt(x, y), Pt(x + glyph_bitmap.width, y + glyph_bitmap.rows),
Re: Unable to compile GIT verion with freetype-2.5.4
I'm so sorry that my english language is weak. Yes. If I understand correctly, for new freetype we need to convert the 'cons unsigned int' to just 'int' and conversely.Geoff the Medio wrote:are you asking what GG::Y is? It's a typedef of int.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Unable to compile GIT verion with freetype-2.5.4
Change toasm64 wrote:I think here it is necessary to perform the reverse conversion and I dont know how to do it.. (cuint -> GG:Y)Code: Select all
max_y = y + glyph_bitmap.rows +1; //Leave a one pixel gap between glyphs
Code: Select all
max_y = y + Y(glyph_bitmap.rows + 1);
Code: Select all
max_y = y + Y(static_cast<int>(glyph_bitmap.rows) + 1);
Also do Value(y)Here I tried replace x to Value(x) but problem in buffer.at. Here we need do something with glyph_bitmap.*Code: Select all
buffer.at(x + glyph_bitmap.width, y + glyph_bitmap.rows) = 0;
Should be able to do Value(x) and Value(y), but then you'd need to wrap then in GG::X and GG::Y constructors to pass to the Pt constructor...And here is the same throube. We need glyph_bitmap.* variables conversation.Code: Select all
TempGlyphData(Pt(x, y), Pt(x + glyph_bitmap.width, y + glyph_bitmap.rows)
Code: Select all
TempGlyphData(Pt(x, y), Pt(X(Value(x) + glyph_bitmap.width), Y(Value(y) + glyph_bitmap.rows))
Re: Unable to compile GIT verion with freetype-2.5.4
Yah! This works fine!Geoff the Medio wrote:Change toCode: Select all
max_y = y + Y(glyph_bitmap.rows + 1);
I done just not wrote about it. But did not got result. Here is the same solution, I simple replace to:Geoff the Medio wrote:Also do Value(y)Here I tried replace x to Value(x) but problem in buffer.at. Here we need do something with glyph_bitmap.*Code: Select all
buffer.at(x + glyph_bitmap.width, y + glyph_bitmap.rows) = 0;
Code: Select all
buffer.at(x + X(glyph_bitmap.width), y + Y(glyph_bitmap.rows)) = 0;
Why the excess conversion? I simple has doneGeoff the Medio wrote:Should be able to do Value(x) and Value(y), but then you'd need to wrap then in GG::X and GG::Y constructors to pass to the Pt constructor...Code: Select all
TempGlyphData(Pt(x, y), Pt(X(Value(x) + glyph_bitmap.width), Y(Value(y) + glyph_bitmap.rows))
Code: Select all
TempGlyphData(Pt(x, y), Pt(x + X(glyph_bitmap.width), y + Y(glyph_bitmap.rows))
Thanks.
I attach the patch. But it my first patch and I may done something wrong.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [SOLVED] Unable to compile GIT verion with freetype-2.5.
I can't apply that patch using TortoiseSVN, but it's small enough I can copy-paste the updated lines by hand...
Edit: builds OK with the old version of FreeType.
Edit: builds OK with the old version of FreeType.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]