Date: Mon, 30 Nov 1998 11:18:13 -0800 From: "Ghulam Dastgir" <banta@ghulam.force9.co.uk> To: <nvp@mediaone.net> Cc: <freebsd-questions@FreeBSD.ORG> Subject: Re: XWindows programming Message-ID: <01be1c96$2d07a360$3684a6c3@signup>
next in thread | raw e-mail | index | archive | help
Hi Nate,
thanks for replying. I've tried what you've said but I still get the same
errors. I've confirmed that all the named directories exist.
This porbably seems extreme but I'm thinking of re-installing XWindows on my
FBSD2.2.6 (perhaps there's some bug somewhere !?!).
Any thoughts. Thanks again.
Ghulam
p.s. I've included another sample short C program in question :-
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
main() {
Display *display;
Window window;
int screen;
unsigned long foreground, background;
display = XOpenDisplay ("");
if (display == NULL) {
fprintf(stderr, "cannot connect to server\n");
exit (EXIT_FAILURE);
}
screen = DefaultScreen(display);
background = WhitePixel(display, screen);
foreground = BlackPixel(display, screen);
window = XCreateSimpleWindow(display, DefaultRootWindow(display), 100,
50, 350,250, 2, foreground, background);
if (window == NULL) {
fprintf(stderr,"cannot open window\n");
exit(EXIT_FAILURE);
}
XMapRaised(display, window);
XFlush(display);
sleep(5);
XDestroyWindow(display, window);
XCloseDisplay(display);
exit (EXIT_SUCCESS);
}
-----Original Message-----
From: nvp@mediaone.net <nvp@mediaone.net>
To: Ghulam Dastgir <banta@ghulam.force9.co.uk>
Cc: freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG>
Date: Sunday, November 29, 1998 11:56 AM
Subject: Re: XWindows programming
>
>> I've just started X programming using Xlib and when I compile my C
>> program, that includes the header file Xlib.h, I get errors for all
>> the Xlib.h declared functions my C program calls, like:
>
>You should be using the (gcc) options -I/usr/X11R6/include and
>-L/usr/X11R6/lib as well as -lX11 -lXt, so:
>
>prompt$ gcc -I/usr/X11R6/include -L/usr/X11R6/lib file.c -lX11 -lXt
>
>--
>Nate Patwardhan
>nvp@mediaone.net
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01be1c96$2d07a360$3684a6c3>
