Compiling a simple C source with command line cc on OS X

Compiling a simple C source with command line cc on OS X

Post by Ian Jenkinso » Mon, 30 Apr 2001 00:35:53



Ladies and Gentlemen,
        I'm having a bit of trouble on Mac OS X that I hope someone might be
able to cast some light for me. I'm trying to compile a simple 50 line
or so piece of code that calls 'gethostname'. I'm new to Mac, but in my
days of Unix, this function was normally to be found in the 'socket' or
'nsl' libraries, so I would compile along the lines of 'cc -o <name>
<three c files> -lsocket -lnsl.
        I see on Mac (or perhaps I'm not looking hard enough or in the right
place) that the /usr/lib directory doesn't contain these libraries, but
does have some others.
        Could anyone enlighten me as to where these functions are declared for
the purpose of compiling code that does 'network tcp stuff'?
        Thanks in advance.
        Ian
 
 
 

Compiling a simple C source with command line cc on OS X

Post by meero » Mon, 30 Apr 2001 04:29:25




Quote:>Ladies and Gentlemen,
>    I'm having a bit of trouble on Mac OS X that I hope someone might be
>able to cast some light for me. I'm trying to compile a simple 50 line
>or so piece of code that calls 'gethostname'. I'm new to Mac, but in my
>days of Unix, this function was normally to be found in the 'socket' or
>'nsl' libraries, so I would compile along the lines of 'cc -o <name>
><three c files> -lsocket -lnsl.

Those should be in the System framework, and it should be linked in for
you by default, so I don't think you need anything special, but if you
do, it's probably -framework System

hth

meeroh
--
You can get random signatures if you put text files into a folder called "Random Signatures" in your Preferences folder.

 
 
 

1. Shell Command Line Length & Command Line Function Resolution

I am trying to update the tornado 2.0.2 vxworks kernel for two different
issues:

1) I would like to increase the maximum command buffer length for the serial
terminal.  It is currently limited to 128 characters.  I cannot find a #define
for that value.

2) I would like to have overloaded functions automatically resolved for command
line execution to the non-object function as follows:

foo(int,int)
foo_obj::foo(int,int)

When entering foo(0,1) at the serial command line, I want it automatically
resolved to the function foo() and not foo_obj::foo().  The shell prompts for
function resolution, but I don't want our users burdoned with that question
since they will always be referring to foo() and not foo_obj::foo().

2. Shell Problems

3. Coalescing command-line and command-line-window?

4. Smart Storage Solutions 2x6 OR Smart & Friendly's CDR2006 2x6???

5. command line compile etc.

6. Superscript characters in proc report column headers

7. Compiling VxWorks using Tornado 2.0 from Command Line

8. Ripped music

9. Command line syntax for compiling Tornado projects

10. Command line compiling in Tornado 2

11. I need a Vim script or a command line for simple task

12. How to send snmp trap containing a simple message from Windows NT Command Line to NetView

13. simple command line environment