newb compile question

N

none

hi all,

(i am running on win 2k pro).

i saw a program i like on a website and when i went to download it it was
just a load of 'c' code.

now, i know very little about 'c' or programming but I downloaded 'miracle
c' and pasted the code in and when i comiled it i got a load of errors.
(below)

to me the errors suggested there is a directory structure and many .h files
(libraries?) missing.

question is, is it as easy as manually creating the missing directory
structure based on the error messages and putting the missing files in them
or is there more to it.

and next question is where do I get the missing .h files (libraries?)

thanks

n


Miracle C Compiler (r3.2), written by bts.
line 18: #include sys/types.h ignored--file not found.
line 19: #include sys/socket.h ignored--file not found.
line 20: #include netinet/in.h ignored--file not found.
line 21: #include arpa/inet.h ignored--file not found.
line 22: #include netdb.h ignored--file not found.
line 24: #include unistd.h ignored--file not found.
line 25: #include fcntl.h ignored--file not found.
line 27: #include errno.h ignored--file not found.
line 44: #define ignored--formal arg must be an identifier.
Compiling C:\Program Files\Miracle C\test.c
 
K

Karthik Kumar

none said:
hi all,

(i am running on win 2k pro).

i saw a program i like on a website and when i went to download it it was
just a load of 'c' code.




Miracle C Compiler (r3.2), written by bts.
line 18: #include sys/types.h ignored--file not found.
line 19: #include sys/socket.h ignored--file not found.
line 20: #include netinet/in.h ignored--file not found.
line 21: #include arpa/inet.h ignored--file not found.
line 22: #include netdb.h ignored--file not found.
line 24: #include unistd.h ignored--file not found.
line 25: #include fcntl.h ignored--file not found.
line 27: #include errno.h ignored--file not found.
line 44: #define ignored--formal arg must be an identifier.
Compiling C:\Program Files\Miracle C\test.c

The list of headers that are reported to be missing are all
non-standard headers, which means a C compiler need not / may not
support it.

<OT>
May be, try to compile this on a *NIX environment with the GNU C/C++
compiler system. If you encounter any issues, please post to
relevant n.g - comp.unix.programmer / gnu.gcc.help , since they
are Off-topic here.
</OT>
 
N

none

The list of headers that are reported to be missing are all
non-standard headers, which means a C compiler need not / may not
support it.

<OT>
May be, try to compile this on a *NIX environment with the GNU C/C++
compiler system. If you encounter any issues, please post to
relevant n.g - comp.unix.programmer / gnu.gcc.help , since they
are Off-topic here.
</OT>


thanks for your response.

wow.. and there was me thinking i had an idea what was going on.. now i am
completely confused.

hey sorry for the off topic post.

n
 
B

Ben Pfaff

none said:
question is, is it as easy as manually creating the missing directory
structure based on the error messages and putting the missing files in them
or is there more to it.

and next question is where do I get the missing .h files (libraries?)

Read the C 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).
 
P

pete

Karthik said:
The list of headers that are reported to be missing are all
non-standard headers, which means a C compiler need not / may not
support it.

errno.h is a standard header file.
 
K

Keith Thompson

pete said:
errno.h is a standard header file.

<QUIBBLE>
It's a standard header, not necessarily a standard header file.
</QUIBBLE>

Warning: The following is almost pure speculation.

You have to use the correct syntax to refer to it:

#include <errno.h>

The OP said he cut-and-pasted the code from a web site. The reported
error messages make me suspect that the '<' and '>' characters were
lost (I'd expect the text between the '<' and '>' to vanish as well,
but we can't tell exactly what happened).

That's assuming that Miracle C would ordinarily include the delimiters
in error messages. On the other hand, if a compiler sees

#include errno.h

it should complain about the bad syntax, not about a missing file.
I have no idea how Miracle C behaves in this area.
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top