simple X window program not compile, plz help

Eirik Byrkjeflot Anonsen eirik at opera.com
Mon Nov 1 00:35:11 PDT 2010


"eric lin" <fsshl at luxmail.com> writes:

> dear Alan or any x window user/programers:
>
>   it compile success by your last suggestion
> but when I run it, 
> Segmentation fault (anyone can tell me why?)(that book's code actually is already illegal on my system's x window grammer, plus
>                     I have hard time to figure it out what that book's authors's explanation.  But I won't abondon it in short time.)
> that book is really pretty unorganized, especially code in ununiform.  But that is so far I can get most approach to X on linux, which is I borrow from Los Angeles's central city library at downtown.  I also see another book, "Motif", in that library also doing graphic on Unix, written by c++.  I search a little bit on google's motif part, i find a simple c code and I copy it and try to compile it on my system, but it not work
> -------------------------------
> root at eric-laptop:/home/eric# gcc try3.c -lXaw -lXt -lX11  -lXm
> try3.c:2:20: error: Xm/Xm.h: No such file or directory

Here's your (first) problem.  You need to install the development
package for motif as well (probably libmotif-dev).  (Also, you should
place -lXm before -lXt on the command line, and you can probably drop
-lXaw).

But really, take Alan's advice and start looking at Qt or Gtk instead.
They are much easier to program, and are generally better in every way.

eirik



More information about the xorg mailing list