Results 1 to 11 of 11

Thread: can't compile clanLib

  1. #1
    Squire
    Join Date
    Dec 2014
    Posts
    10

    Default can't compile clanLib

    I have an Ubuntu 14.10 64 Bit.
    I use head from the ClanLib github Repo.

    I get the following error by compile clanDisplay:
    Code:
    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?

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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

  3. #3
    Squire
    Join Date
    Dec 2014
    Posts
    10

    Default

    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]
    }
    ^
    Last edited by Sven Pfannkuch; 12-23-2014 at 11:49 PM.

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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)

  5. #5
    Squire
    Join Date
    Dec 2014
    Posts
    10

    Default

    Quote Originally Posted by rombust View Post
    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:

    Code:
    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 ?
    Last edited by Sven Pfannkuch; 12-25-2014 at 11:16 AM.

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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.

  7. #7
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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

  8. #8
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    For others reading this. This problem was fixed.

  9. #9
    Squire
    Join Date
    Dec 2014
    Posts
    10

    Default

    Quote Originally Posted by rombust View Post
    For others reading this. This problem was fixed.
    If the changes are already in the repository?

  10. #10
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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!

  11. #11

    Default

    Hurray-hurray!)

Similar Threads

  1. succeed to compile ClanLib-3.0
    By lurrak in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 05-26-2013, 01:05 AM
  2. trying to compile ClanLib-3.0
    By lumak in forum Official ClanLib SDK Forums
    Replies: 9
    Last Post: 05-26-2013, 01:04 AM
  3. Can't Compile ClanLib project?
    By CloudVII in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-11-2012, 04:37 PM
  4. ClanLib + Eclipse. Can't compile.
    By igorpan in forum Official ClanLib SDK Forums
    Replies: 8
    Last Post: 05-23-2012, 03:08 AM
  5. Can't compile ClanLib on OpenBSD
    By zmyrgel in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 03-06-2008, 07:57 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •