源码包下载地址:https://motif.ics.com/motif/downloads
另外一个需要注册的网站:http://www.opengroup.org/openmotif/downloads.html
Motif 安装有两种方式:
源码包编译安装
-
下载源码包motif-2.3.8.tar.gz并解压;
-
阅读 INSTALL.configure 文件,先安装好必要的库;
yum install libX*
-
进行编译环境配置;
cd motif ./configure
-
编译、安装;
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安装
- 这种方式十分简单。下载对应于自己操作系统的二进制代码包例如
motif-2.3.4-1.x86_64.rpm; - 再执行如下命令安装即可:
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’