LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Can't get MOTIF to compile with my libraries... (https://www.linuxquestions.org/questions/programming-9/cant-get-motif-to-compile-with-my-libraries-18496/)

jwblair 04-14-2002 01:48 PM

Can't get MOTIF to compile with my libraries...
 
Hello, I am using Red Hat 7.2 and I am trying to write a X/Motif hello world program. I just cant get the program to compile. The source code is correct because I am using an example off the web. However, I can't get it to link to the correct libraries. It can't find the header files that it needs. Please take a look below at my path:

[root@localhost chapter-2]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@localhost chapter-2]#

This is what happens when I compile the program:

[root@localhost chapter-2]# make hello
cc hello.c -o hello
hello.c:5:22: Xm/PushB.h: No such file or directory
make: *** [hello] Error 1
[root@localhost chapter-2]#

The library files for X/Motif are located here and are as follows:
[root@localhost include]# pwd
/usr/X11R6/include
[root@localhost include]# ls -als
total 40
4 drwxr-xr-x 6 root root 4096 Apr 6 05:11 .
4 drwxr-xr-x 8 root root 4096 Apr 6 04:44 ..
4 drwxr-xr-x 2 root root 4096 Apr 6 05:11 DPS
0 lrwxrwxrwx 1 root root 30 Apr 6 05:11 Dt -> ../LessTif/Motif2.1/include/Dt
0 lrwxrwxrwx 1 root root 31 Apr 6 05:11 Mrm -> ../LessTif/Motif1.2/include/Mrm
0 lrwxrwxrwx 1 root root 31 Apr 6 05:11 uil -> ../LessTif/Motif1.2/include/uil
4 drwxr-xr-x 14 root root 4096 Apr 6 05:11 X11
0 lrwxrwxrwx 1 root root 9 Apr 6 05:11 Xaw3d -> X11/Xaw3d
4 drwxr-xr-x 2 root root 4096 Apr 6 05:11 Xbae
4 -r--r--r-- 1 root root 2934 Sep 5 2001 xf86Optrec.h
12 -r--r--r-- 1 root root 10310 Sep 5 2001 xf86Parser.h
4 drwxr-xr-x 2 root root 4096 Apr 6 05:11 Xlt
0 lrwxrwxrwx 1 root root 30 Apr 6 05:11 Xm -> ../LessTif/Motif1.2/include/Xm
[root@localhost include]#

Here are my makefiles:
[root@localhost chapter-2]# more Imakefile Makefile.raw
::::::::::::::
Imakefile
::::::::::::::
SYS_LIBRARIES = -lXm -lXt -lSM -lICE -lX11

AllTarget(hello)

NormalProgramTarget(hello,hello.o,,,)
::::::::::::::
Makefile.raw
::::::::::::::
PROGRAMS = hello

CFLAGS=
INCLUDES = -I/usr/Motif21/include -I/usr/X11R6/include
LIBS= -L/usr/Motif21/lib -L/usr/X11R6/lib -lXm -lXt -lSM -lICE -lX11

all: $(PROGRAMS)

.c: ; $(CC) $(CFLAGS) $(INCLUDES) $@.c $(LIBS) -o $@

clean::
-rm -f $(PROGRAMS) *.o

[root@localhost chapter-2]#

So what am I doing wrong? :rolleyes: Please, anything would help...

Thanks!

-Bill

Eternal 04-16-2002 06:18 AM

From /usr/X11R6/include do :

file ../LessTif/Motif2.1/include/Dt etc...

because i doubt you have a /usr/X11R6/LessTiff
But most probly a /usr/X11R6/(lib|include)/LessTiff

but to be frack, im getting used to reply to question that i dont know the answer maybe read the README for the LessTiff version needed.

Hano 04-28-2002 06:35 PM

if still getting problems uninstall Lesstif libraries and try OpenMotif 2.2



Hano


All times are GMT -5. The time now is 08:38 AM.