最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

how to make nanox

工作和技术 crifan 2856浏览 0评论

untar microwindows-0.90.tar.gz
then go into the dir : microwindows-0.90
then gon into src
then input following in command line:
make

get error:
winevent.c:19: error: static declaration of ‘abs’ follows non-static declaration

so we delete the prefix "static" ,then we can go on.

make

we got error:
Compiling devimage.c …
devimage.c:754:21: error: jpeglib.h: No such file or directory

so I found the way to slove it in :
http://www.dm7000s.com/viewthread.php?tid=762

apt-file search -F jpeglib.h
but show error:
The program ‘apt-file’ is currently not installed. You can install it by typing:
sudo apt-get install apt-file
Make sure you have the ‘universe’ component enabled
bash: apt-file: command not found

so I do :
sudo apt-get install libjpeg62-dev

then we can install jpeg lib.
then make

we get error:
——————————————————————————————————–
Compiling font_freetype.c …
font_freetype.c:14:31: error: freetype/freetype.h: No such file or directory
font_freetype.c:15:30: error: freetype/ftxkern.h: No such file or directory
font_freetype.c:16:31: error: freetype/ftnameid.h: No such file or directory
font_freetype.c:17:30: error: freetype/ftxcmap.h: No such file or directory
font_freetype.c:18:31: error: freetype/ftxwidth.h: No such file or directory
——————————————————————————————————–
obviously,this is lack freetype lib.
In:
http://bbs.chinaunix.net/viewthread.php?tid=35866
I found ,I should install some lib or some version about freetype
so do :
apt-cache search freetype

we get:
——————————————————————————————————–
fontconfig – generic font configuration library – support binaries
libdirectfb-extra – direct frame buffer graphics – extra providers
libgd-gd2-perl – Perl module wrapper for libgd – gd2 variant
libpango1.0-0 – Layout and rendering of internationalized text
libpango1.0-0-dbg – The Pango library and debugging symbols
libpango1.0-common – Modules and configuration files for the Pango
libpango1.0-dev – Development files for the Pango
libpango1.0-doc – Documentation files for the Pango
libsdl-ttf2.0-0 – ttf library for Simple DirectMedia Layer with FreeType 2 support
libttf-dev – FreeType 1 development files (static library and headers)
libttf2 – FreeType 1, The FREE TrueType Font Engine, shared library files
libxft-dev – FreeType-based font drawing library for X (development files)
libxft2 – FreeType-based font drawing library for X
libxft2-dbg – FreeType-based font drawing library for X (unstripped)
scribus – Open Source Desktop Publishing
x-ttcidfont-conf – Configure TrueType and CID fonts for X
libfreetype6 – FreeType 2 font engine, shared library files
libfreetype6-dev – FreeType 2 font engine, development files
php5-gd – GD module for php5
freetype2-demos – FreeType 2 demonstration programs
cjk-latex – A LaTeX macro package for CJK (Chinese/Japanese/Korean)
freetype1-tools – Bundled tests, demos and tools for FreeType 1
ftgl-dev – Library to render text in OpenGL using FreeType
ftjam – FreeType version of Jam, a replacement for make
fttools – FreeType font utilities
fvwm – F(?) Virtual Window Manager, version 2.5
fvwm-gnome – F(?) Virtual Window Manager, version 2.5
latex-hangul-ucs – LaTeX package to support Hangul
libafterimage-dev – imaging library designed for AfterStep – development files
libafterimage0 – imaging library designed for AfterStep – runtime files
libcamlimages-ocaml – OCaml image processing library
libcamlimages-ocaml-dev – OCaml image processing library
libclan2c2a-ttf – TTF module for ClanLib game SDK
libcoin40c2 – high-level 3D graphics kit with Open Inventor and VRML97 support – runtime
libft-perl – Perl module for the FreeType library
libgd-gd2-noxpm-perl – Perl module wrapper for libgd – gd2 variant without XPM support
libotf-bin – A Library for handling OpenType Font – utilities
libotf-dev – A Library for handling OpenType Font – development
libotf0 – A Library for handling OpenType Font – runtime
libotf0-dbg – The libotf libraries and debugging symbols
libwftk-0.7c2a – WorldForge Toolkit – a C++ widget toolkit
libwftk-dev – WorldForge Toolkit – a C++ widget toolkit – development files
libwftk-doc – WorldForge Toolkit – a C++ widget toolkit – documentation
libxft1 – FreeType-based font drawing library for X (version 1)
mknfonts.tool – Create nfont packages for GNUstep
mlterm – MultiLingual TERMinal
mlterm-tiny – MultiLingual TERMinal, tiny version
pointless – A presentation tool based on OpenGL
rxvt-unicode – RXVT-like terminal emulator with Unicode support
rxvt-unicode-lite – RXVT-like terminal emulator with basic Unicode support
ttf2pt1 – A TrueType to PostScript Type 1 Font Converter
ttmkfdir – Utility used to create fonts.scale files for TrueType fonts
vflib3 – Versatile Font Library
vflib3-bin – Sample programs using VFlib3
vflib3-dev – Development files for VFlib3
vflib3-doc – Documentation for VFlib3
scribus-ng – Open Source Desktop Page Layout – developmental branch
——————————————————————————————————–
so I think I should install the :
freetype1-tools – Bundled tests, demos and tools for FreeType 1

so type:
sudo apt-get install freetype1-tools

but I got:
——————————————————————————————————–
Reading package lists… Done
Building dependency tree      
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
freetype1-tools: Depends: libttf2 (= 1.4pre.20050518-0.3) but 1.4pre.20050518-0.5build1 is to be installed
E: Broken packages
——————————————————————————————————–
so type:
sudo apt-get install libttf2

so go to find how to install the version you want:

sudo apt-get install libttf2=1.4pre.20050518-0.3

then :
sudo apt-get install freetype1-tools

actually,I found its reason is lack of freetype.h
and we find in :
http://www.debian.org/doc/manuals/apt-howto/ch-search.zh-cn.html#s-auto-apt
——————————————————————————————————–
另一个定位软件包的方法是知道软件包中某个关键文件的名称。例如,你编译时需要某个“.h”头文件,查找提供该文件的软件包,你可以运行:

     # dpkg -S stdio.h
     libc6-dev: /usr/include/stdio.h
     libc6-dev: /usr/include/bits/stdio.h
     perl: /usr/lib/perl/5.6.0/CORE/nostdio.h

或者:

     # dpkg -S /usr/include/stdio.h
     libc6-dev: /usr/include/stdio.h
——————————————————————————————————–
so we do:
dpkg -S freetype.h
we got:
libfreetype6-dev: /usr/include/freetype2/freetype/freetype.h
then we install the development package :
sudo apt-get install libfreetype6-dev

then edit the src/config file like this:
——————————————————————————————————–
####################################################################
# TrueType font support thru FreeType 1.x
####################################################################
HAVE_FREETYPE_SUPPORT    = Y
INCFTLIB                 = /usr/include/freetype2
LIBFTLIB                 = /usr/lib/libttf.so.2
FREETYPE_FONT_DIR        = "fonts/truetype"

####################################################################
——————————————————————————————————–
because freetype/freetype.h in /usr/include/freetype2
and the lib is in /usr/lib/, and its name is libttf.so.2

also ,we should copy the .ttf file into src/fonts/truetype
but we have not the .ttf file,so we download the microwindows-fonts-0.90.tar.gz :
refer site :
计算机世界网-如何在Microwindows中显示图片和安装字体
http://www.ccw.com.cn/htm/center/prog/02_9_10_5.asp
ftp://microwindows.censoft.com/pub/microwindows/microwindows-0.90.tar.gz
ftp://microwindows.censoft.com/pub/microwindows/microwindows-fonts-0.90.tar.gz

and untar it we ,get the truetype directory ,and there are many .ttf file in it.
copy the whole truetype directory in to src directory.

then go on to make
also get other error:
——————————————————————————————————–
In file included from font_freetype.c:14:
/usr/include/freetype2/freetype/freetype.h:20:2: error: #error "`ft2build.h’ hasn’t been included yet!"
/usr/include/freetype2/freetype/freetype.h:21:2: error: #error "Please always use macros to include FreeType header files."
/usr/include/freetype2/freetype/freetype.h:22:2: error: #error "Example:"
/usr/include/freetype2/freetype/freetype.h:23:2: error: #error " #include <ft2build.h>"
/usr/include/freetype2/freetype/freetype.h:24:2: error: #error " #include FT_FREETYPE_H"
font_freetype.c:15:30: error: freetype/ftxkern.h: No such file or directory
font_freetype.c:16:31: error: freetype/ftnameid.h: No such file or directory
font_freetype.c:17:30: error: freetype/ftxcmap.h: No such file or directory
font_freetype.c:18:31: error: freetype/ftxwidth.h: No such file or directory
——————————————————————————————————–
so:
crifan@crifan-desktop:~/download$ dpkg -S ft2build.h
libfreetype6-dev: /usr/include/ft2build.h
we already have the .h file,but not include the /usr/include/,so can’ find it.
so we has two way:

method 1:
edit src/Makefile.rules
add two line:
INCLUDEDIRS += -I$(INSTALL_PREFIX)/include
# above added -I$(INSTALL_PREFIX)/include is /usr/include for /usr/include/ft2build.h

like this:
——————————————————————————————————–
# Includes
INCLUDEDIRS += -I. -I$(TOP)/include
INCLUDEDIRS += -I$(INSTALL_PREFIX)/include
# above added -I$(INSTALL_PREFIX)/include is /usr/include for /usr/include/ft2build.h
——————————————————————————————————–
method 2:
sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype
——————————————————————————————————–
the above two method should be OK .but not takes effect ! ?
there is still the error:
——————————————————————————————————–
/usr/include/freetype2/freetype/freetype.h:20:2: error: #error "`ft2build.h’ hasn’t been included yet!"
/usr/include/freetype2/freetype/freetype.h:21:2: error: #error "Please always use macros to include FreeType header files."
/usr/include/freetype2/freetype/freetype.h:22:2: error: #error "Example:"
/usr/include/freetype2/freetype/freetype.h:23:2: error: #error " #include <ft2build.h>"
/usr/include/freetype2/freetype/freetype.h:24:2: error: #error " #include FT_FREETYPE_H"

——————————————————————————————————–
finnally ,I find in ft2build.h :
——————————————————————————————————–
#ifndef __FT2_BUILD_UNIX_H__
#define __FT2_BUILD_UNIX_H__

/* `<prefix>/include/freetype2′ must be in your current inclusion path */
#include <freetype/config/ftheader.h>

#endif /* __FT2_BUILD_UNIX_H__ */
——————————————————————————————————–
but the freetype.h is to judge wheather the FT_FREETYPE_H is defined ,but not __FT2_BUILD_UNIX_H__ :
——————————————————————————————————–
#ifndef FT_FREETYPE_H
#error "`ft2build.h’ hasn’t been included yet!"
#error "Please always use macros to include FreeType header files."
#error "Example:"
#error " #include <ft2build.h>"
#error " #include FT_FREETYPE_H"
#endif
——————————————————————————————————–
and after read follow:
——————————————————————————————————–
FreeType 2 教程
http://blog.csdn.net/is01sjjj/archive/2006/12/07/1433077.aspx
——————————————————————————————————–
then go to look /usr/include/freetype2/freetype/configfthearder.h
——————————————————————————————————–
/* public headers */

/*************************************************************************
   *
   * @macro:
   *   FT_FREETYPE_H
   *
   * @description:
   *   A macro used in #include statements to name the file containing the
   *   base FreeType 2 API.
   *
   */
#define FT_FREETYPE_H <freetype/freetype.h>
——————————————————————————————————–
so we konw , if we not define __FT2_BUILD_UNIX_H__
we konw
   we have not include ft2build.h
so we have not include freetype/config/ftheader.h
so we have not include freetype/freetype.h

donot care much ,we delete the ifdef in ft2build.h ,like this :
——————————————————————————————————–
/* #ifndef __FT2_BUILD_UNIX_H__ */
#define __FT2_BUILD_UNIX_H__

/* `<prefix>/include/freetype2′ must be in your current inclusion path */
#include <freetype/config/ftheader.h>

/* #endif */
/* __FT2_BUILD_UNIX_H__ */
——————————————————————————————————–
then add:
#include <ft2build.h>

before:
——————————————————————————————————–
#ifndef FT_FREETYPE_H
#error "`ft2build.h’ hasn’t been included yet!"
#error "Please always use macros to include FreeType header files."
#error "Example:"
#error " #include <ft2build.h>"
#error " #include FT_FREETYPE_H"
#endif
——————————————————————————————————–
in freetype.h.
——————————————————————————————————–
refer website:
Debian下编译gbkfonts
http://hi.baidu.com/bluebanboom/blog/item/c32a095500317ec4b745ae21.html

——————————————————————————————————–
go on make:
——————————————————————————————————–
but still can’t find that .h file :
——————————————————————————————————–
font_freetype.c:15:30: error: freetype/ftxkern.h: No such file or directory
font_freetype.c:16:31: error: freetype/ftnameid.h: No such file or directory
font_freetype.c:17:30: error: freetype/ftxcmap.h: No such file or directory
font_freetype.c:18:31: error: freetype/ftxwidth.h: No such file or directory
——————————————————————————————————–
from refer website:
编译microwindows出错..
http://www.linuxsir.org/bbs/printthread.php?t=210938

I know ,the freetype1 have these files.
so want to install the freetype1.
so :
——————————————————————————————————–
apt-cache search freetype
——————————————————————————————————–
and find:
——————————————————————————————————–
libttf-dev – FreeType 1 development files (static library and headers)
so install the libttf-dev:
sudo apt-get install libttf-dev

then go on make:
but error:
——————————————————————————————————–
                 from font_freetype.c:15:
/usr/include/freetype/freetype.h:27:2: error: #error "This is freetype.h of FreeType 1!"
/usr/include/freetype/freetype.h:28:2: error: #error "Please fix the directory search order for header files"
/usr/include/freetype/freetype.h:29:2: error: #error "so that freetype.h of FreeType 2 is found first."
——————————————————————————————————–
do follow:

crifan@crifan-desktop:~/download/microwindows-0.90/src$ sudo cp /usr/include/freetype/freetype.h /usr/include/freetype/freetype_backup.h
crifan@crifan-desktop:~/download/microwindows-0.90/src$ sudo rm /usr/include/freetype/freetype.h

——————————————————————————————————–
in the end ,I do not do the freetype1 ,I go to edit the config file ,to set up :
support freetype 2,and not support freetype1 ,like this :
——————————————————————————————————–
####################################################################
# TrueType font support thru FreeType 1.x
####################################################################
HAVE_FREETYPE_SUPPORT    = N
INCFTLIB                 = /usr/include/freetype2
LIBFTLIB                 = /usr/lib/libttf.so.2
FREETYPE_FONT_DIR        = "fonts/truetype"

####################################################################
# Support for many kinds of font thru FreeType 2.x
# Must also set FREETYPE_FONT_DIR in the Freetype 1.x section
####################################################################
HAVE_FREETYPE_2_SUPPORT = Y
INCFT2LIB                = /usr/include/freetype2
LIBFT2LIB                = /usr/lib/libfreetype.a
——————————————————————————————————–
then go on make ,but error:
——————————————————————————————————–
font_freetype2.c: In function ‘freetype2_createfont_internal’:
font_freetype2.c:618: error: ‘FTC_ImageTypeRec’ has no member named ‘font’
——————————————————————————————————–
and in microwindows-0.90/src/engine/font_freetype2.c :
——————————————————————————————————–
#if HAVE_FREETYPE_2_CACHE
#if HAVE_FREETYPE_VERSION_AFTER_OR_EQUAL(2,1,3)
    FTC_ImageTypeRec imagedesc;
#else
    FTC_ImageDesc imagedesc;
#endif
#if HAVE_FREETYPE_2_CMAP_CACHE
    FTC_CMapDescRec cmapdesc;
#endif
#else
    FT_Face face;
#endif
    FT_Matrix matrix;
——————————————————————————————————–
so baidu and google to look for FTC_ImageTypeRec, and learned , after FreeType-2.1.3,the FTC_ImageDesc has been replaced
by FTC_ImageTypeRec.
refer website:
http://osdir.com/ml/lib.gnustep.user/2003-06/msg00032.html

and in FreeType-2.1.3 and FreeType-2.1.7 ,the define of the structure of FTC_ImageTypeRec is :
——————————————————————————————————–
FTC_FontRec

typedef struct FTC_FontRec_
{
    FTC_FaceID face_id;
    FT_UShort   pix_width;
    FT_UShort   pix_height;

} FTC_FontRec;

A simple structure used to describe a given `font’ to the cache manager. Note that a `font’ is the combination of a given face with a given character size.

fields
face_id   

The ID of the face to use.
pix_width   

The character width in integer pixels.
pix_height   

The character height in integer pixels.



FTC_ImageTypeRec
typedef struct FTC_ImageTypeRec_
{
    FTC_FontRec font;
    FT_Int32     flags;

} FTC_ImageTypeRec;
typedef struct FTC_ImageTypeRec_*   FTC_ImageType;

A simple structure used to describe the type of glyph image to be loaded into the cache.

fields
font   

An FTC_FontRec used to describe the glyph’s face and size.
flags   

The load flags to be applied when loading the glyph; see the FT_LOAD_XXX constants for details.
note

This type completely replaces the FTC_Image_Desc structure which is now obsolete.
——————————————————————————————————–
refer website:
FreeType-2.1.3 API Reference Cache Sub-System
http://swlx01.hs-esslingen.de/doc/usr-doc/freetype-2.1.3/docs/reference/ft2-cache_subsystem.html#FTC_FontRec

FreeType-2.1.7 API Reference Cache Sub-System
http://www.ibr.cs.tu-bs.de/cgi-bin/dwww?type=file&location=/usr/share/doc/libfreetype6-dev/reference/ft2-cache_subsystem.html#FTC_FontRec

but in FreeType-2.2.1 ,the define of the structure of FTC_ImageTypeRec is
——————————————————————————————————–
FTC_ImageTypeRec
typedef struct FTC_ImageTypeRec_
{
    FTC_FaceID face_id;
    FT_Int      width;
    FT_Int      height;
    FT_Int32    flags;

} FTC_ImageTypeRec;

A structure used to model the type of images in a glyph cache.

fields
face_id   

The face ID.
width   

The width in pixels.
height   

The height in pixels.
flags   

The load flags, as in FT_Load_Glyph.
——————————————————————————————————–
refer website:
FreeType-2.2.1 API Reference Cache Sub-System
http://materiales.fis.puc.cl/cgi-bin/dwww/usr/share/doc/libfreetype6/reference/ft2-cache_subsystem.html

in FreeType-2.2.1 ,the developer stead the font by its original defination ,then put them together.
that is the reason why we can’t find the font in FTC_ImageTypeRec in FreeType-2.2.1 !!!

also disrciption like this :
The cache API has been slightly modified (it’s still a beta!): – The type FTC_ImageDesc has been removed; it is now replaced by FTC_ImageTypeRec.

refer website:
FreeType 2.1.10
http://sourceforge.net/project/shownotes.php?group_id=94270&release_id=366434

from google,we konw the FTC_ImageTypeRec define in ftcache.h

refer website:
http://www.bessrc.aps.anl.gov/software/qt4-x11-4.2.2-browser/globals_0x66.html
——————————————————————————————————–
other ,we can down file :
libfreetype6_2.1.10-1ubuntu2.4_i386.deb
freetype_2.1.10.orig.tar.gz
from:
http://ubuntu.cn99.com/ubuntu/pool/main/f/freetype/
down file :
libfreetype6-udeb_2.1.10-1ubuntu2_i386.udeb
from:
http://mirror.lupaworld.com/ubuntu/archive/pool/universe/f/freetype/
——————————————————————————————————–
google FreeType-2.1.7 ,and we can download the file :
http://prdownloads.sourceforge.net/freetype/freetype-2.1.7.tar.bz2
http://www.linuxfromscratch.org/patches/blfs/5.1/freetype-2.1.7-bytecode-interpreter.patch

refer website:
http://www.linuxfromscratch.org/blfs/view/5.1/general/freetype2.html

untar it ,then do as that website say :
patch -Np1 -i ../freetype-2.1.7-bytecode-interpreter.patch
./configure –prefix=/usr
make
make install

then go on make ,then error:
——————————————————————————————————–
wlist.c:16: error: static declaration of ‘windows’ follows non-static declaration
nanowm.h:173: error: previous declaration of ‘windows’ was here
——————————————————————————————————–
so change src/demos/nanowm/wlist.c:
static win *windows = NULL;
to:
/* static win *windows = NULL; */
win *windows = NULL;

——————————————————————————————————–

转载请注明:在路上 » how to make nanox

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (2)

  1. 已经发给你了。
    againinput417年前 (2007-10-10)回复
  2. 你好,能不能把microwindows-0.90.tar.gz发给我一份,我下载不到,官方网站也不行,谢了。[email protected]
    lvjunonline17年前 (2007-09-13)回复
82 queries in 0.192 seconds, using 22.19MB memory