Compiling Programs contains Xutility calls

E

ehabaziz2001

How can I compile that program under Solaris 8 using gcc and what
header files will be used ?


main()
{
/* Define default values: */

int n = 0;
float x = 0.0;

/* Define contents of dialog window */

create_int_dialog_entry("n", &n);
create_float_dialog_entry("x", &x);

/* Create window with name "Setup" and top-left corner at (0,0) */

set_up_dialog("Setup", 0, 0);

/* Display the window and read the results */

read_dialog_window();

/* Print out the new values */

printf("n = %d, x = %f\n", n, x);
}
 
R

Richard Heathfield

Ian Collins said:
I suggest you read the manual or documentation for Xutility.

That's not the correct form of main, it returns int.

To be more precise, it's correct in K&R C and C90 (where the int return type
is implicit). It is indeed incorrect in C99.
 
K

Keith Thompson

Where can I download the header file xutility.h for compiling a C
program ?

Downloading just a header file is seldom useful. You need the version
of the header that's appropriate for your system, and you need the
code that implements whatever the header declares.

The header file is likely to be part of some software package, and you
need the whole thing.

A Google search shows several different things called "xutility"; I
don't know which one you're looking for.
 
B

Ben Pfaff

I need the header file xutility.h for unix compilation using gcc.

This is in the FAQ.

10.11: I seem to be missing the system header file <sgtty.h>.
Can someone send me a copy?

A: Standard headers exist in part so that definitions appropriate
to your compiler, operating system, and processor can be
supplied. You cannot just pick up a copy of someone else's
header file and expect it to work, unless that person is using
exactly the same environment. Ask your compiler vendor why the
file was not provided (or to send a replacement copy).
 
K

Keith Thompson

I need the header file xutility.h for unix compilation using gcc.

In my previous respone, which you didn't quote, I wrote:

| Downloading just a header file is seldom useful. You need the version
| of the header that's appropriate for your system, and you need the
| code that implements whatever the header declares.
|
| The header file is likely to be part of some software package, and you
| need the whole thing.
|
| A Google search shows several different things called "xutility"; I
| don't know which one you're looking for.

I still don't know what you're looking for. If you told us exactly
what version of gcc, what variant of Unix, and what hardware you're
using, I *still* wouldn't know what you're looking for.

xutility.h must be part of some software package. You need to find
and install that package; even if you could find the single file
"xutility.h", it almost certainly wouldn't do you any good.

As Ben Pfaff pointed out (and I should have thought to mention
myself), this is also question 10.11 in the comp.lang.c FAQ,
<http://www.c-faq.com>.
 
O

Oscar del Rio

How can I compile that program under Solaris 8 using gcc and what
header files will be used ?


main()
{
/* Define default values: */

int n = 0;
float x = 0.0;

/* Define contents of dialog window */

create_int_dialog_entry("n", &n);
create_float_dialog_entry("x", &x);

/* Create window with name "Setup" and top-left corner at (0,0) */

set_up_dialog("Setup", 0, 0);

/* Display the window and read the results */

read_dialog_window();

/* Print out the new values */

printf("n = %d, x = %f\n", n, x);
}


let me guess... you are following a C tutorial from this site
http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/c_tutorial.html#dialog-box
that says you need their "xutility" package

The same page links to instructions on how to compile the code
http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/compile.html

"the xutility library... contains (among other things) a set of plotting
functions written by Biao Lu (a former graduate student who left us
in 1994) which form the basis for much of the graphics we will need to do
during the quarter."

In other words, what you need should be somewhere on that site or you have to
contact them directly or follow other tutorials elsewhere.

Is my guess correct?
 
K

Keith Thompson

Yes that is correct ? How can I get that package ?

Yes, what is correct? Google Groups now automatically quotes the
previous article when you post a followup; you need to keep enough of
that to provide context. Read <http://cfaj.freeshell.org/google/>.

Your question cannot be answered within the C programming language.
Followups redirected, with comp.lang.c and alt.comp.lang.learn.c-c++
dropped.

You might have better luck contacting the authors of the web page
where you got the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top