libXt编译问题

博客内容讲述了在编译libXt时遇到找不到StringDefs.h和Shell.h头文件的错误。通过研究makestrs工具的使用,发现需要在util目录下使用makestrs命令生成头文件。执行特定操作后,成功生成所需头文件并解决了编译问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 iwmmxt_le-gcc -DHAVE_CONFIG_H -I. -I.. -I../include/ -I../include/X11 -I../include -I../include/X11 -I/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/include -I/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr//include -DXFILESEARCHPATHDEFAULT=/"/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%L/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%l/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%L/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%l/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/etc/X11/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%L/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%l/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%L/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%l/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/share/X11/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%L/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%l/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%T/%N%C%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%L/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%l/%T/%N%S:/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/%T/%N%S/" -DERRORDB=/"/opt/montavista/cee/devkit/arm/iwmmxt_le/target/usr/lib/X11/XtErrorDB/" -DMALLOC_0_RETURNS_NULL -DXTMALLOC_BC -g -O2 -MT ActionHook.lo -MD -MP -MF .deps/ActionHook.Tpo -c ActionHook.c  -fPIC -DPIC -o .libs/ActionHook.o
In file included from ../include/X11/IntrinsicI.h:67,
                 from ActionHook.c:72:
../include/X11/TranslateI.h:442:24: StringDefs.h: No such file or directory
make[3]: *** [ActionHook.lo] Error 1
make[3]: Leaving directory `/opt/webkit/deps/x11/libXt-1.0.3/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/webkit/deps/x11/libXt-1.0.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/webkit/deps/x11/libXt-1.0.3'
make: *** [all] Error 2

 

 

 

一直提示找不到头文件"StringDefs.h"和"Shell.h",GOOGLE了大半天,都说这两个文件在libXt中,换了几个不同的libXt版本,都有同样的问题.查看libXt目录结构时,发现其中有util这个目录,里面有个可执行程序makestrs,还有几个文件StrDefs.ht Shell.ht,非常类似我们要找的这两个头文件.查找了makestrs的用法:

makestrs(1) - Linux man page

Name

makestrs - makes string table C source and header(s)

Synopsis

makestrs [-f source] [-i includedir] [-abioptions ...]

Description

The makestrs command creates string table C source files and headers. If -f source is not specified makestrs will read from stdin. The C source file is always written to stdout. makestrs creates one or more C header files as specified in the source file. The following options may be specified: -sparcabi, -intelabi, -functionabi, -arrayperabi, and -defaultabi.

-sparcabi is used on SPARC platforms conforming to the SPARC Compliance Definition, i.e. SVR4/Solaris.

-intelabi is used on Intel platforms conforming to the System V Application Binary Interface, i.e. SVR4.

-earlyR6abi may be used in addition to -intelabi for situations where the vendor wishes to maintain binary compatibility between X11R6 public-patch 11 (and earlier) and X11R6 public-patch 12 (and later).

-functionabi generates a functional abi to the string table. This mechanism imposes a severe performance penalty and it's recommended that you not use it.

-arrayperabi results in a separate array for each string. This is the default behavior if makestrs was compiled with -DARRAYPERSTR (it almost never is).

-defaultabi forces the generation of the "normal" string table even if makestrs was compiled with -DARRAYPERSTR. Since makestrs is almost never compiled with -DARRAYPERSTR this is the default behavior if no abioptions are specified.

-i includedir forces the reading of templates from the includedir instead of the local directory. This is useful to have separate source and build directories.

Syntax

The syntax for string-list file is (items in square brackets are optional):

#prefix <text>
#feature <text>
#externref <text>
#externdef [<text>]
[#ctempl <text>]
#file <filename>
#table <tablename>
[#htempl]
<text>
<text>
[#table <tablename>
<text>
<text>
...
#table <tablename>
...]
[#file <filename>
...]
In words you may have one or more #file directives. Each #file may have one or more #table directives.

The #prefix directive determines the string that makestr will prefix to each definition.

The #feature directive determines the string that makestr will use for the feature-test macro, e.g. X[TM]STRINGDEFINES.

The #externref directive determines the string that makestr will use for the extern clause, typically this will be "extern" but Motif wants it to be "externalref"

The #externdef directive determines the string that makestr will use for the declaration, typically this will be the null string (note that makestrs requires a trailing space in this case, i.e. "#externdef "), and Motif will use "externaldef(_xmstrings).

The #ctmpl directive determines the name of the file used as a template for the C source file that is generated

Each #file <filename> directive will result in a corresponding header file by that name containing the appropriate definitions as specified by command line options. A single C source file containing the declarations for the definitions in all the headers will be printed to stdout.

The #htmpl directive determines the name of the file used as a template for the C header file that is generated.

Each #table <tablename> directive will be processed in accordance with the ABI. On most platforms all tables will be catenated into a single table with the name of the first table for that file. To conform to the Intel ABI separate tables will be generated with the names indicated.

The template files specified by the #ctmpl and #htmpl directives are processed by copying line for line from the template file to the appropriate output file. The line containing the string <<<STRING_TABLE_GOES_HERE>>> is not copied to the output file. The appropriate data is then copied to the output file and then the remainder of the template file is copied to the output file.

Bugs

makestrs is not very forgiving of syntax errors. Sometimes you need a trailing space after # directives, other times they will mess you up. No warning messages are emitted.

See Also

SPARC Compliance Definition 2.2., SPARC International Inc., 535 Middlefield Road, Suite 210, Menlo Park, CA 94025

System V Application Binary Interface, Third Edition, ISBN 0-13-100439-5 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632

System V Application Binary Interface, Third Edition, Intel386 Architecture Processor Supplement ISBN 0-13-104670-5 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632

System V Application Binary Interface, Third Edition, SPARC Architecture Processor Supplement ISBN 0-13-104696-9 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632

 

 

在目录util下运行makestrs -f StrDefs.ht,程序出现段错误,仔细查看上面文档后,发现makestrs的源文件要遵循一定格式,原来是目录中的string.list.在上一级目录执行makestrs -f util/string.list,成功生成两个头文件StringDefs.h和Shell.h,将其复制到include/X11中,编译一切正常.

 

atk-1.25.2.tar.gz atk-1.26.0.tar.gz bigreqsproto-1.1.2.tar.bz2 cairo-1.8.6.tar.gz CPAN-1.94.tar.gz DirectFB-1.1.1.tar.gz expat-2.0.1.tar.gz expat-2.1.0.tar.gz ExtUtils-MakeMaker-6.20.tar.gz fontconfig-2.4.2.tar.gz fontconfig-2.6.0.tar.gz fontconfig-2.7.3.tar.gz freetype-2.3.5.tar.bz2 freetype-doc-2.3.6.tar.bz2 glib-2.12.1.tar.bz2 glib-2.14.4.tar.gz glib-2.18.2.tar.bz2 glibc-2.2.5.tar.bz2 gtk+-2.10.14.tar.bz2 gtk+-2.10.7.tar.bz2 gtk+-2.12.12.tar.bz2 inputproto-2.2.tar.bz2 jpegsrc.v6b.rar jpegsrc.v6b.tar.gz kbproto-1.0.6.tar.bz2 libpng-1.2.10.tar.bz2 libpng-1.2.32.tar.lzma libpthread-stubs_0.1.orig.tar.gz libsndfile-1.0.28.tar.gz libtool-1.5.22.tar.gz libtool-2.4.2.tar.xz libX11-1.0.3.tar.bz2 libX11-1.2.2.tar.bz2 libX11-1.3.2.tar.gz libX11-1.5.0.tar.bz2 libXau-1.0.7.tar.bz2 libXau-1.0.8.tar.bz2 libxcb-1.3.tar.bz2 libxcb-1.4.tar.bz2 libxcb-1.8.1.tar.bz2 libXdmcp-1.0.3.tar.gz libXdmcp-1.1.2.tar.bz2 libXext-1.0.1.tar.bz2 libXfont-1.4.4.tar.bz2 libXft-2.1.12.tar.bz2 libXft-2.1.13.tar.bz2 libxml2-2.6.30.tar.gz libxml2-2.6.32.tar.gz libxslt-1.1.29.tar.gz libXt-1.0.6.tar.bz2 pango-1.16.4.tar.bz2 pango-1.18.2.tar.gz pango-1.22.1.tar.bz2 pango-1.24.4.tar.bz2 pixman-0.24.0.tar.bz2 poky-pinky-3.1.1.tgz stubs-soft.h tiff-3.8.2.tar.gz tiff-4.0.7.tar.gz tslib-1.4.tar.gz xcb-proto-1.7.1.tar.bz2 xcmiscproto-1.1.2.tar.bz2 xcmiscproto-1.2.2.tar.bz2 xextproto-7.2.1.tar.bz2 xorg-server-1.3.0.0.tar.bz2 xorg-server-1.4.2.tar.bz2 xproto-7.0.23.tar.bz2 xtrans-1.2.7.tar.bz2 zlib-1.2.3.rar zlib-1.2.3.tar.gz zlib-1.2.5.tar.gz
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值