CentOS下 Motif 配置笔记

源码包下载地址:https://motif.ics.com/motif/downloads
另外一个需要注册的网站:http://www.opengroup.org/openmotif/downloads.html

Motif 安装有两种方式:

源码包编译安装

  1. 下载源码包motif-2.3.8.tar.gz并解压;

  2. 阅读 INSTALL.configure 文件,先安装好必要的库;

    yum install libX*
    
  3. 进行编译环境配置;

    cd motif
    ./configure
    
  4. 编译、安装;

    make
    make check
    make install
    

    编译过程中,编译到 motif/tools/wml/wmluiltok.o 遇到如下错误:
    /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function _start (.text+0x20): undefined reference to 'main'

    经查阅crt1.o, crti.o, crtbegin.o, crtend.o, crtn.o文章,发现该错误是 .c 文件中缺少main函数导致的。
    打开 wmluiltok.c 文件查看,motif-2.3.8 中 wmluiltok.c 文件无main函数(这是为什么?),于是改换源代码包ftp://ftp.ics.com/openmotif/2.3/2.3.0/openmotif-2.3.0.tar.gz
    虽然openmotif-2.3.0 的 wmluiltok.c 文件有main函数,但编译过程中依旧报上述错误,利用反汇编命令查看 wmluiltok.o 文件,发现其中并无main函数:

    objdump -dx wmluiltok.o
    

    查看 wmluiltok.c 文件,发现在main函数之前有条件命令:

     #if YY_MAIN
     int main()
     {...}
     #endif
    

    然而 YY_MAIN 在该文件中并未定义,于是将main函数移到该条件之外,重新make,则编译成功,不再报错。
    但这样修改源代码应该是不对的。而且之后在安装edm时发现如下错误:
    /usr/bin/ld: cannot find -lXm collect2: error: ld returned 1 exit status
    找不到 Xm 库,所以 Motif 应该是未安装成功

二进制源码包rpm安装

  1. 这种方式十分简单。下载对应于自己操作系统的二进制代码包例如
    motif-2.3.4-1.x86_64.rpm;
  2. 再执行如下命令安装即可:
    rpm install motif-2.3.4-1.x86_64.rpm
    

安装过程中的一些其他问题可以参考:
在CentOS下如何安装motif?
有关open motif 安装和使用的问题。
crt1.o: In function `_start’: - undefined reference to ‘main’ in Linux
/usr/bin/ld: cannot find -lxxx 的解决办法
一个悬而未决的参考贴:用Ubuntu16.04编译iDT算法(c++)时报错:/usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/x86_64-linux-gnu/crt1.o: In function ‘_start’😦.text+0x20): undefined reference to ‘main’

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值