Beginners X Windows Programming Question

Beginners X Windows Programming Question

Post by robert gru » Wed, 08 Sep 1993 15:54:55



Hi,

I have been writting C programs for a while now, and I am trying to learn
to program C for X Windows.  I have two books here and each one says to
start off with the following code:

        #include </usr/include/stdio.h>
        #incldue </usr/include/X11/Xlib.h>

        main()
        {
         Display        *theDisplay;

        theDisplay = XOpenDisplay(NULL);
        }

Whenever I try to compile the code I get the following message:

        ld:
        Undefined
        XOpenDisplay

Can anyone shed any light on what I'm doing wrong here?  I would really
appreciate email if its not too much trouble.

Thanks!!
--
Bob Gruen
Structural Dynamics Research Corporation
Cincinnati, Ohio
513/576-5635

 
 
 

Beginners X Windows Programming Question

Post by Alvin Chia-Hua Sh » Fri, 10 Sep 1993 22:01:40



        [ code elided... ]

Quote:>Whenever I try to compile the code I get the following message:

>    ld:
>    Undefined
>    XOpenDisplay
>Can anyone shed any light on what I'm doing wrong here?  I would really
>appreciate email if its not too much trouble.

Since you're getting an error message from the linker, "ld", I'd
suspect that you're not compiling your program with the "-lX11" flag.

(Followups to comp.windows.x.)

ACS
--
 ___ ___ ___ ______________________________________________________________
|   |   | __|   "Maybe I'm paranoid, but remember, even paranoids have     |
| - | --|__ |     enemies."--Cal Pryluck, Temple University                |
|_|_|___|___|______________________________________________________________|


 
 
 

1. I am the beginner of C programming, a question I want to ask anybody?

Can you help to solve it?
Question:
[Write a program that reads integer data from the standard input unit and
prints the minimum integer read, maximum integer read, and the average of
the list. Inform your user to press the EOF key (ctrl-d for UNIX system)
after entering the input list.]
The average part I can solve it.
I JUST KNOWN THAT:
    while (scanf("%d",&currentvalue) != EOF)
    {
        .............
    }
But, about finding maximum value and minimum values, I have some difficulty
on it.
ANY wise man help me?

2. crc

3. shell programming question - beginner

4. CodeWarrior on Solaris: advices / next release ?

5. Programming AIX in C - beginners question

6. problem with x

7. A beginner's question on Shell Programming

8. Linux destroyed my Marriage with a weed-eater!!!

9. A few beginner's questions on netscape, pico, programming

10. X windows programming question - window borders

11. Beginner Question ! Fail to setup X Windows !

12. get unix x-windows program to start microsoft windows program

13. HARD X-windows programming question