Compilation Help - Motif

This is a discussion on Compilation Help - Motif ; Just a quick question (hopefully it is fairly easy). I am working through this web page ( http://www.cs.cf.ac.uk/Dave/X_lecture/X_book_caller/ ) about X Window/Motif programming. I am wrote the push.c program, and tried compiling it. [snippet] cc push.c -o push -lXm -lXt ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Compilation Help

  1. Compilation Help

    Just a quick question (hopefully it is fairly easy). I am working
    through this web page
    (http://www.cs.cf.ac.uk/Dave/X_lecture/X_book_caller/) about X
    Window/Motif programming.
    I am wrote the push.c program, and tried compiling it.

    [snippet]
    cc push.c -o push -lXm -lXt -lX11
    push.c:1:19: Xm/Xm.h: No such file or directory
    push.c:2:22: Xm/PushB.h: No such file or directory
    [/snippet]

    I checked my Xm directory in /usr/X11R6/include and did find both Xm.h
    and PushB.h in that directory.

    Is anyone able to explain to me why cc or gcc for that matter is unable
    to see these files?
    Am I missing an export somewhere?
    Any help would be greatly appreciated.

    Jason Schultz

  2. Re: Compilation Help

    Jason wrote in news:KU4Lb.19828$ts4.11190@pd7tw3no:
    > cc push.c -o push -lXm -lXt -lX11
    > push.c:1:19: Xm/Xm.h: No such file or directory
    > push.c:2:22: Xm/PushB.h: No such file or directory
    > [/snippet]
    >
    > I checked my Xm directory in /usr/X11R6/include and did find both Xm.h
    > and PushB.h in that directory.


    You need to set your include path. Try adding -I/usr/X11R6/include to your
    cc command. You may also need to add a -L/usr/X11R5/lib to get your program
    to link. The imake or xmkmf programs will set all this up for you.

    Ken Lee, http://www.rahul.net/kenton/

  3. Re: Compilation Help

    Ken Lee wrote:
    > Jason wrote in news:KU4Lb.19828$ts4.11190@pd7tw3no:
    >
    >>cc push.c -o push -lXm -lXt -lX11
    >>push.c:1:19: Xm/Xm.h: No such file or directory
    >>push.c:2:22: Xm/PushB.h: No such file or directory
    >>[/snippet]
    >>
    >>I checked my Xm directory in /usr/X11R6/include and did find both Xm.h
    >>and PushB.h in that directory.

    >
    >
    > You need to set your include path. Try adding -I/usr/X11R6/include to your
    > cc command. You may also need to add a -L/usr/X11R5/lib to get your program
    > to link. The imake or xmkmf programs will set all this up for you.
    >
    > Ken Lee, http://www.rahul.net/kenton/


    That worked, thank you very much

  4. Re: Compilation Help

    Jason wrote in message news:...

    > I am wrote the push.c program, and tried compiling it.
    >
    > [snippet]
    > cc push.c -o push -lXm -lXt -lX11
    > push.c:1:19: Xm/Xm.h: No such file or directory
    > push.c:2:22: Xm/PushB.h: No such file or directory
    > [/snippet]


    Try cc -I/usr/X11R6/include push.c -o push -L/usr/X11R6/lib -lXm -lXt -lX11
    >
    > I checked my Xm directory in /usr/X11R6/include and did find both Xm.h
    > and PushB.h in that directory.


    They should be at /usr/X11R6/include/Xm/

    --- Casantos

+ Reply to Thread