[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Newbie C Question



Art Lemasters wrote:
  >     I've never written C for any UNIX but want very
  >much to learn.  Getting started might be the most
  >difficult part.  The following question appears to me
  >to be a somewhat Debian-Linux-specific (although I could
  >be wrong).
  >
  >     How do I compile and link hello.c?  ...can't
  >seem to find stdio.h for linking.  Hopefully, the
  >answer to that will get me started.  Thanks.
 
Source file helloc.c should look something like this:


=======
#include <stdio.h>

main()
{
	printf("Hello world\n");
}
=======


compile it with

gcc -o hello hello.c


If you get errors, you probably haven't installed all the packages you need:

gcc, cpp, binutils, libc6-dev (this assumes Debian 2.0; use libc5 if
you're still on bo)
-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Look not every man on his own things, but every man 
      also on the things of others."        Philippians 2:4 



--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: