PDA

View Full Version : can't compile clanLib



Sven Pfannkuch
12-23-2014, 01:41 PM
I have an Ubuntu 14.10 64 Bit.
I use head from the ClanLib github Repo.

I get the following error by compile clanDisplay:

Font/font_face_impl.cpp: In member function 'void clan::FontFace_Impl::load_font(const clan::FontDescription&, clan::DataBuffer&)':
Font/font_face_impl.cpp:97:4: error: 'filename' was not declared in this scope
filename = PathHelp::get_filename(font_file_path, PathHelp::path_type_file);
^
Font/font_face_impl.cpp:98:4: error: 'fs' was not declared in this scope
fs = FileSystem(path);
^


What am I doing wrong?

rombust
12-23-2014, 10:58 PM
Your not going anything wrong ;)

It's me. I forgot to test the code on linux, before I submitted the patch.

Font/font_face_impl.cpp:97 --> add "std::string" before "filename = "
Font/font_face_impl.cpp:98 --> add "FileSystem" before "fs = "

I can't commit for a couple of weeks, maybe someone else will be able to test and fix this

Sven Pfannkuch
12-23-2014, 11:23 PM
I have an another error:


Font/FontEngine/font_engine_freetype.cpp: In member function 'void clan::FontEngine_Freetype::calculate_font_metrics( )':
Font/FontEngine/font_engine_freetype.cpp:583:3: error: 'desc' was not declared in this scope
desc.get_line_height() // Calculated in FontMetrics as height + metrics.tmExternalLeading if not specified
^
Font/FontEngine/font_engine_freetype.cpp:573:8: warning: unused variable 'avg_char_width' [-Wunused-variable]
float avg_char_width = (max_char_width * 2.0f) / 3.0f;
^
Font/FontEngine/font_engine_freetype.cpp: In member function 'virtual clan::FontPixelBuffer clan::FontEngine_Freetype::get_font_glyph(int)':
Font/FontEngine/font_engine_freetype.cpp:150:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

rombust
12-24-2014, 08:21 AM
Font/FontEngine/font_engine_freetype.cpp:150

Change "get_font_glyph_standard" to "return get_font_glyph_standard"

For Font/FontEngine/font_engine_freetype.cpp:583

Pass "description"into calculate_font_metrics(); at Font/FontEngine/font_engine_freetype.cpp:126

Line 261 ... void FontEngine_Freetype::calculate_font_metrics(const FontDescription &desc)

Remember to also change the definition in font_engine_freetype.h

(By inspection, not tested)

Sven Pfannkuch
12-25-2014, 12:02 AM
Font/FontEngine/font_engine_freetype.cpp:150

Change "get_font_glyph_standard" to "return get_font_glyph_standard"

For Font/FontEngine/font_engine_freetype.cpp:583

Pass "description"into calculate_font_metrics(); at Font/FontEngine/font_engine_freetype.cpp:126

Line 261 ... void FontEngine_Freetype::calculate_font_metrics(const FontDescription &desc)

Remember to also change the definition in font_engine_freetype.h

(By inspection, not tested)

Please test it
for me it does not work
it gives more errors:


X11/font_config.cpp: In member function 'std::string clan::FontConfig::match_font(const clan::FontDescription&) const':
X11/font_config.cpp:77:32: error: cannot convert 'clan::FontWeight' to 'int' in initialization
int weight = desc.get_weight();
^
X11/font_config.cpp:82:67: error: call of overloaded 'abs(float)' is ambiguous
FC_PIXEL_SIZE, FcTypeDouble, (double) std::abs(desc.get_height()),
^
X11/font_config.cpp:82:67: note: candidates are:
In file included from /usr/include/c++/4.9/cstdlib:72:0,
from /usr/include/c++/4.9/ext/string_conversions.h:41,
from /usr/include/c++/4.9/bits/basic_string.h:2850,
from /usr/include/c++/4.9/string:52,
from /usr/include/c++/4.9/stdexcept:39,
from ../../Sources/API/Core/System/exception.h:33,
from ../../Sources/Display/precomp.h:40,
from X11/font_config.cpp:29:
/usr/include/stdlib.h:775:12: note: int abs(int)
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^
In file included from /usr/include/c++/4.9/ext/string_conversions.h:41:0,
from /usr/include/c++/4.9/bits/basic_string.h:2850,
from /usr/include/c++/4.9/string:52,
from /usr/include/c++/4.9/stdexcept:39,
from ../../Sources/API/Core/System/exception.h:33,
from ../../Sources/Display/precomp.h:40,
from X11/font_config.cpp:29:
/usr/include/c++/4.9/cstdlib:166:3: note: long int std::abs(long int)
abs(long __i) { return __builtin_labs(__i); }
^
/usr/include/c++/4.9/cstdlib:174:3: note: long long int std::abs(long long int)
abs(long long __x) { return __builtin_llabs (__x); }
^
X11/font_config.cpp:84:33: error: 'const class clan::FontDescription' has no member named 'get_italic'
FC_SLANT, FcTypeInteger, desc.get_italic() ? FC_SLANT_ITALIC : FC_SLANT_ROMAN,
^
X11/font_config.cpp:85:35: error: 'const class clan::FontDescription' has no member named 'get_fixed_pitch'
FC_SPACING, FcTypeInteger, desc.get_fixed_pitch() ? FC_MONO : FC_PROPORTIONAL,
^


Why do you submitted your changes not just in the repo ?

rombust
12-26-2014, 09:38 PM
I have already said at the start, "I can't commit for a couple of weeks, maybe someone else will be able to test and fix this "

I have not got access to a PC that I can use for development.

rombust
12-28-2014, 09:10 PM
By looking at the github source, the other errors you are getting should be easily fixed as follows:


Change from:
desc.get_italic() ? FC_SLANT_ITALIC : FC_SLANT_ROMAN
To:
desc.get_style() == FontStyle::italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN


Change from:
std::abs(desc.get_height())
To:
static_cast<doube>(desc.get_height())

Change from:
desc.get_fixed_pitch() ? FC_MONO : FC_PROPORTIONAL
To:
FC_PROPORTIONAL

rombust
01-06-2015, 09:27 PM
For others reading this. This problem was fixed.

Sven Pfannkuch
01-06-2015, 09:56 PM
For others reading this. This problem was fixed.

If the changes are already in the repository?

rombust
01-07-2015, 11:30 PM
Yeah. However, you may notice lots of changes in the coming months, that occasionally may break the Linux build.

We are tidying up ClanLib ready for a Spring release.

The only major thing that's left to do is to update the examples to use clanUI instead of clanGUI. (This requires the porting of some clanGUI components)

And someone to write documentation. Nah, that'll never happen!

ArtHome
01-08-2015, 12:50 AM
Hurray-hurray!)