f



Compile time error: "error: 'write_n' is not a member of 'ACE'"

Hi All,

ACE VERSION: 5.5.6
HOST MACHINE and OPERATING SYSTEM: LINUX, Kernel 2.6.19-1.2288.fc5,
i686

I tried to compile the program given below, but was giving following
compilation error:
Please help me to compile this proram

---------------------------------------
COMPILATION------------------------------------------
[root@paresh ACE_MSG_BLOCK]# g++ main.C -o main -lACE -IACE_ROOT
main.C: In function 'int main(int, char**)':
main.C:9: error: 'read_n' is not a member of 'ACE'
main.C:20: error: 'write_n' is not a member of 'ACE'
----------------------------------END
COMPILATION--------------------------------------------



---------------------------------------------PROGRAM
main.C---------------------------------------------

#include "ace/OS.h"
#include "ace/Message_Block.h"

int main(int argc, char* argv[]) {
        ACE_Message_Block *head = new  ACE_Message_Block(BUFSIZ);
        ACE_Message_Block *mblk = head;

        for(;;) {
                ssize_t nbytes = ACE::read_n(ACE_STDIN, mblk-
>wr_ptr(), mblk->size());
                if(nbytes <= 0)
                        break;

                mblk->wr_ptr(nbytes);

                mblk->cont(new ACE_Message_Block(BUFSIZ));
                mblk = mblk->cont();
        }

        for(mblk = head; mblk != 0/*NULL POINTER*/; mblk = mblk-
>cont()) {
                ACE::write_n(ACE_STDOUT, mblk->rd_ptr(), mblk-
>length());
        }

        head->release();
        return 0;
}

------------------------------- END
-------------------------------------

0
Paresh
3/15/2007 6:59:22 PM
comp.soft-sys.ace 20326 articles. 1 followers. marlow.andrew (167) is leader. Post Follow

0 Replies
933 Views

Similar Articles

[PageSpeed] 15

Reply: