Professional Web Applications Themes

I can't compile late Stevens first couple od code from apue - UNIX Programming

Hello, I,m unix newbie and currently learning c. My problem is I can't compile first couple of codes from late Stevens book Advanced programming in unix environment. whenever I try to compile the very first code I get error. It seems all the error functions (err_sys, err_quit etc) are not wroking. My os is freebsd 5.0. Can you help me? Perhaps its not the best place to post a newbie's message but I am really helpless. If u need the more info, I'll send u all the steps I performed. Regards,...

  1. #1

    Default I can't compile late Stevens first couple od code from apue

    Hello,
    I,m unix newbie and currently learning c. My problem is
    I can't compile first couple of codes from late Stevens book Advanced
    programming in unix environment. whenever I try to compile the very first
    code I get error.
    It seems all the error functions (err_sys, err_quit etc) are not wroking.
    My os is freebsd 5.0. Can you help me?
    Perhaps its not the best place to post a newbie's message but I am really
    helpless. If u need the more info, I'll send u all the steps I performed.
    Regards,



    vectrum Guest

  2. #2

    Default Re: I can't compile late Stevens first couple od code from apue

    On Tue, 6 Jan 2004, vectrum wrote:
     

    Did you compile the apue library first?
     

    This is the right place to ask!

    --
    Rich Teer, SCNA, SCSA

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-online.net
    Rich Guest

  3. #3

    Default Re: I can't compile late Stevens first couple od code from apue


    "Rich Teer" <com> wrote in message
    news:rite-group.com... 
     [/ref]

     [/ref]
     


    This is the right place to ask, but some of us aren't too savvy on the
    technical lingo. So you should avoid overly-technical explanations like "the
    functions are not working" and instead use simpler terms like "my linker
    generates a 'symbol not found' error for following symbols" or "my compiler
    generates the following error message".

    DS




    David Guest

  4. #4

    Default Re: I can't compile late Stevens first couple od code from apue

    David Schwartz wrote:
     
    > [/ref]
    > [/ref]

    >
    > This is the right place to ask, but some of us aren't too
    > savvy on the technical lingo. So you should avoid
    > overly-technical explanations like "the functions are not
    > working" and instead use simpler terms like "my linker
    > generates a 'symbol not found' error for following symbols" or
    > "my compiler generates the following error message".[/ref]

    Vectrum...

    Because you're a newbie; and because I think I just heard David's
    flamethrower burp (ever so gently), I'd like to suggest that you
    follow the link in my sig to an excellent doent on asking
    "smart" questions...

    You may find some of the others helpful, as well.
    --
    Morris Dovey
    West Des Moines, Iowa USA
    C links at http://www.iedu.com/c
    Read my lips: The apple doesn't fall far from the tree.

    Morris Guest

  5. #5

    Default Re: I can't compile late Stevens first couple od code from apue


    "vectrum" <com> wrote in message
    news:btetvo$65isd$news.uni-berlin.de... 
    performed. 
    Take a look Appendix B in his book. Steven's has a custom header
    "ourhdr.h" which he defines err_sys, err_quit and others.

    Howerver, here's another option:

    Take a look at the first program that demonstrates read and write.
    Use the man with "2" as follows:

    man 2 read
    man 2 write

    This will tell you important specifics on the command and
    necessary headers. You can substitute

    fprintf(stderr, " your error message")

    for some of his err_* files. This command it good
    to know...because fprintf(stderr is unbuffered...it will print a
    message immediately.

    #include <unistd.h>
    #include <stdlib.h>
    #include <stdio.h>
    #define BUFFSIZE 8192
    int
    main(void)
    {
    int n;
    char buf[BUFFSIZE];

    while ( (n= read(STDIN_FILENO, buf, BUFFSIZE)) > 0 )
    if (write(STDOUT_FILENO, buf, n) != n)
    fprintf(stderr,"write error\n");

    if (n < 0 )
    fprintf(stderr, "read error\n");

    exit(0);
    }

    ok..the lazy way is to take a look at the website...I think they have
    specifics for compiling on each platform; but, then you miss out on all the
    interesting stuff.

    Regards,

    Mike Chirico


    Mike Guest

Similar Threads

  1. compile the proxy code error in .net 2003 command promp
    By dahang in forum ASP.NET Web Services
    Replies: 1
    Last Post: March 7th, 07:09 PM
  2. what order does code compile in?
    By Alexander Ross in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 5th, 09:18 PM
  3. Replies: 3
    Last Post: January 23rd, 07:06 PM
  4. A mysterious excerpt from UNPv1 by W. R. Stevens
    By e1p1s in forum UNIX Programming
    Replies: 5
    Last Post: August 4th, 09:03 AM
  5. Can I compile regular ASP-code in to an aspx-file?
    By Göran Carlefyr in forum ASP.NET General
    Replies: 2
    Last Post: July 24th, 12:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139