C/C++ fatal error: 'Xm/Xm.h' file not found , motif installed

senenmut

New Member


Messages: 12

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
Code:
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.
1. linux-c6-openmotif
2. linux-c7-motif
but that are onlylibraries for linux support.
normally the main motif library from UNIXBSD should run.
freebsd32bit is up to date.
xorg installed. xfce desktop is working.
i only want to compile this damn C - Motif script. nothing else
Then Coffee and Relax.
The Xm/Xm include file is the main include file in Every script.
Impossible to be not there.

Attention : i found another error on a different compilation.
X11/Intrinsic.h NOT FOUND


WBR
Senenmut
 

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

if it gets put in the includes on FBSD then try this on your line
Code:
cc -L/usr/local/lib -I/usr/local/include -o button button.c -lXm -lXt -lX11
 
OP
OP
senenmut

senenmut

New Member


Messages: 12

hey man , yes that works. i checked out on two scripts.
how do you know that ?
what can i do more to fix my motif installation ?
have i done something wrong in the installation ?

many thanks.
SM
 

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

I do not think so, I had to find this out too, coming from Linux. I just add that to my command line and makefiles when I compile in FreeBSD to what little I do, and it works.
 
OP
OP
senenmut

senenmut

New Member


Messages: 12

userxbw ,
yeah i want to program in C with Motif on native unix. not Gnu-Linux.
The original System-V unix.
Have some code ready and it works.
I stay on freebsd. nothing else.
 

userxbw

Well-Known Member

Reaction score: 29
Messages: 294

I do not know all of the nuts and bolts of how to with clang and FreeBSD. All I've ever done is take my stuff I wrote in Linux, and someone else's source code for some stuff I use and made it work in FreeBSD too.
If you just stick with FreeBSD then of course over time will/should get to know what to do to get your C code to work. for that one partt just remeber to add your -L/usr/local/lib and -I/usr/local/include and what ever else and if everything is written as it should be then it will work.
 

kpedersen

Daemon

Reaction score: 587
Messages: 1,523

Ports and packages in FreeBSD are installed to /usr/local.

So it makes sense that includes are in /usr/local/include and libs are in /usr/local/lib.

By default the compilers do not include these paths by default (similar that on Solaris, suncc doesn't include things from /opt/csw, /usr/sfw, etc).

The -L/usr/local/lib -I/usr/local/include compiler flags simply add these two directories to search for libs and includes respectively.

if you use CMake or Autotools, this isn't necessary because these tools include these paths.
 
Top