Hello,
i have installed open-motif -2.3.8_1 X11 Toolkit on freebsd32bit machine.
wanna compile a little script. script is ok. already compiled on other machine (linux)
the message is as follows
cc -o button button.c -lXm -lXt -lX11
button.c:3:10: fatal error: 'Xm/Xm.h' file not found
#include <Xm/Xm.h> /*Motif include file*/
1 error generated
$
How can this be possible if open-motif is correct installed ?
there are only two other motif packages.
linux-c6-openmotif
linux-c7-motif
Attention : i found another error when compiling another script.
X11/Intrinsic.h NOT FOUND
Good that you were able to solve the problem by your own. But after working on few posts in this thread and suddenly declaring that you have solved the problem will not help anyone.
I would like to request you to please do add your solution which helped you fix your problem in this thread do that future users could be benefited too. Cheers and happy learning on this great site.
It is always wise to include your library and include paths when compiling a program in C.
Here is your first (you said not working) attempt:
cc -o button button.c -lXm -lXt -lX11
Here is your working attempt:
cc -L/usr/local/lib -I/usr/local/include -o button button.c -lXm -lXt -lX11
The only difference is that you have included your paths, which is standard. If you do not include the paths, how will cc know where to search for include files and libraries?
This is why you should always search your file system when you encounter such a compile-time error and then, as you have done, include the correct paths.