GCC compiler error

Discussion in 'C Programming' started by Tsb, Oct 12, 2007.

  1. Tsb

    Tsb Guest

    Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    write my C program, and then just do like this.

    #gcc MYFILE.NAME -o MYFILE.NAME
    #MYFILE.NAME

    then it works well. but second time I use like this, there are some
    errors.

    Errors are:

    #gcc MYFILE.NAME -o MYFILE.NAME
    #MYFILE.NAME
    /home/tsb/C/C.c:7:1804: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\3' in program
    /home/tsb/C/C.c:7:1809: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\10' in program
    /home/tsb/C/C.c:7:1811: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\230' in program
    /home/tsb/C/C.c:7: error: stray '\202' in program
    /home/tsb/C/C.c:7: error: stray '\4' in program
    /home/tsb/C/C.c:7: error: stray '\10' in program
    /home/tsb/C/C.c:7:1820: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\3' in program
    /home/tsb/C/C.c:7:1825: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\203' in program
    /home/tsb/C/C.c:7: error: stray '\4' in program
    /home/tsb/C/C.c:7: error: stray '\10' in program
    /home/tsb/C/C.c:7:1836: warning: null character(s) ignored
    /home/tsb/C/C.c:7: error: stray '\3' in program
    /home/tsb/C/C.c:7:1841: warning: null character(s) ignored
    /home/tsb/C/C.c:8:1: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '\234' in program
    /home/tsb/C/C.c:8: error: stray '\204' in program
    /home/tsb/C/C.c:8: error: stray '\4' in program
    /home/tsb/C/C.c:8: error: stray '\10' in program
    /home/tsb/C/C.c:8:10: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '\3' in program
    /home/tsb/C/C.c:8:15: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '\250' in program
    /home/tsb/C/C.c:8: error: stray '\204' in program
    /home/tsb/C/C.c:8: error: stray '\4' in program
    /home/tsb/C/C.c:8: error: stray '\10' in program
    /home/tsb/C/C.c:8:26: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '\3' in program
    /home/tsb/C/C.c:8:31: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '`' in program
    /home/tsb/C/C.c:8: error: stray '\225' in program
    /home/tsb/C/C.c:8: error: stray '\4' in program
    /home/tsb/C/C.c:8: error: stray '\10' in program
    /home/tsb/C/C.c:8:42: warning: null character(s) ignored
    /home/tsb/C/C.c:8: error: stray '\3' in program
    /home/tsb/C/C.c:8:47: warning: null character(s) ignored
    /home/tsb/C/C.c:9:1: warning: null character(s) ignored
    /home/tsb/C/C.c:9: error: stray '\225' in program
    /home/tsb/C/C.c:9: error: stray '\4' in program
    /home/tsb/C/C.c:9: error: stray '\10' in program
    /home/tsb/C/C.c:9:10: warning: null character(s) ignored
    /home/tsb/C/C.c:9: error: stray '\3' in program
    /home/tsb/C/C.c:9:15: warning: null character(s) ignored
    /home/tsb/C/C.c:9: error: stray '\16' in program
    /home/tsb/C/C.c:9:17: warning: null character(s) ignored
    /home/tsb/C/C.c:9: error: stray '\225' in program

    Does anyone know why it happed?
    Tsb, Oct 12, 2007
    #1
    1. Advertising

  2. Tsb

    Tsb Guest

    Or Should I use another compiler on FreeBSD? Which one is suitable for
    beginners(like me) on FreeBSD ?
    Tsb, Oct 12, 2007
    #2
    1. Advertising

  3. In article <>,
    Tsb <> wrote:
    >Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    >write my C program, and then just do like this.


    >#gcc MYFILE.NAME -o MYFILE.NAME


    You overwrote your source file with the compiled binary.
    --
    "No one has the right to destroy another person's belief by
    demanding empirical evidence." -- Ann Landers
    Walter Roberson, Oct 12, 2007
    #3
  4. Tsb

    Tsb Guest

    On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    wrote:
    > In article <>,
    >
    > Tsb <> wrote:
    > >Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    > >write my C program, and then just do like this.
    > >#gcc MYFILE.NAME -o MYFILE.NAME

    >
    > You overwrote your source file with the compiled binary.


    Now what do i have to do?

    > --
    > "No one has the right to destroy another person's belief by
    > demanding empirical evidence." -- Ann Landers
    Tsb, Oct 12, 2007
    #4
  5. Tsb

    Ian Collins Guest

    Tsb wrote:
    > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    > wrote:
    >> In article <>,
    >>
    >> Tsb <> wrote:
    >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    >>> write my C program, and then just do like this.
    >>> #gcc MYFILE.NAME -o MYFILE.NAME

    >> You overwrote your source file with the compiled binary.

    >
    > Now what do i have to do?
    >

    type it in again...

    --
    Ian Collins.
    Ian Collins, Oct 12, 2007
    #5
  6. Tsb

    Tsb Guest

    On Oct 12, 2:23 pm, Ian Collins <> wrote:
    > Tsb wrote:
    > > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    > > wrote:
    > >> In article <>,

    >
    > >> Tsb <> wrote:
    > >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    > >>> write my C program, and then just do like this.
    > >>> #gcc MYFILE.NAME -o MYFILE.NAME
    > >> You overwrote your source file with the compiled binary.

    >
    > > Now what do i have to do?

    >
    > type it in again...
    >
    > --
    > Ian Collins.


    I type it again. Then compile once and there still will be error.

    I want to execute my program many times.

    I am new in C, so I don't know clearly. If I want to use "#gcc
    MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?
    Tsb, Oct 12, 2007
    #6
  7. Tsb

    Guest

    On Oct 12, 8:32 am, Tsb <> wrote:
    > On Oct 12, 2:23 pm, Ian Collins <> wrote:
    >
    >
    >
    > > Tsb wrote:
    > > > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    > > > wrote:
    > > >> In article <>,

    >
    > > >> Tsb <> wrote:
    > > >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    > > >>> write my C program, and then just do like this.
    > > >>> #gcc MYFILE.NAME -o MYFILE.NAME
    > > >> You overwrote your source file with the compiled binary.

    >
    > > > Now what do i have to do?

    >
    > > type it in again...

    >
    > > --
    > > Ian Collins.

    >
    > I type it again. Then compile once and there still will be error.
    >
    > I want to execute my program many times.
    >
    > I am new in C, so I don't know clearly. If I want to use "#gcc
    > MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?


    Just don't do that. Try something like:
    gcc MYFILE.NAME -o MYFILE.OTHERNAME
    MYFILE.OTHERNAME

    These commands you can execute as many times as you want.

    But first start reading the gcc-manual, especially the section on the -
    o option.

    Kind regards,
    Johan Borkhuis
    , Oct 12, 2007
    #7
  8. Tsb

    Richard Bos Guest

    Tsb <> wrote:

    > On Oct 12, 2:23 pm, Ian Collins <> wrote:
    > > Tsb wrote:
    > > > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    > > >> Tsb <> wrote:
    > > >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    > > >>> write my C program, and then just do like this.
    > > >>> #gcc MYFILE.NAME -o MYFILE.NAME
    > > >> You overwrote your source file with the compiled binary.

    > >
    > > > Now what do i have to do?

    > >
    > > type it in again...
    > >
    > > --
    > > Ian Collins.


    Do not quote signatures, please.

    > I type it again. Then compile once and there still will be error.
    >
    > I want to execute my program many times.
    >
    > I am new in C, so I don't know clearly. If I want to use "#gcc
    > MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?


    Simple: do _not_ do that. Not many times, not once. You _cannot_ use the
    same name for your C file and for your compiled program, as a moment's
    consideration will explain to you.

    Richard
    Richard Bos, Oct 12, 2007
    #8
  9. Tsb

    Tsb Guest

    On Oct 12, 2:46 pm, (Richard Bos) wrote:
    > Tsb <> wrote:
    > > On Oct 12, 2:23 pm, Ian Collins <> wrote:
    > > > Tsb wrote:
    > > > > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    > > > >> Tsb <> wrote:
    > > > >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    > > > >>> write my C program, and then just do like this.
    > > > >>> #gcc MYFILE.NAME -o MYFILE.NAME
    > > > >> You overwrote your source file with the compiled binary.

    >
    > > > > Now what do i have to do?

    >
    > > > type it in again...

    >
    > > > --
    > > > Ian Collins.

    >
    > Do not quote signatures, please.
    >
    > > I type it again. Then compile once and there still will be error.

    >
    > > I want to execute my program many times.

    >
    > > I am new in C, so I don't know clearly. If I want to use "#gcc
    > > MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?

    >
    > Simple: do _not_ do that. Not many times, not once. You _cannot_ use the
    > same name for your C file and for your compiled program, as a moment's
    > consideration will explain to you.


    Oh. I understood. I shouldn't write "MYFILE.NAME -o MYFILE.NAME"

    I just tried like this and it worked very well. Now I got it. Thanks.

    #gcc /home/tsb/C/C.c -o /home/tsb/C/a
    #/home/tsb/C/a

    Two names has to be different.

    >
    > Richard
    Tsb, Oct 12, 2007
    #9
  10. Tsb <> writes:
    > On Oct 12, 2:23 pm, Ian Collins <> wrote:
    >> Tsb wrote:
    >> > On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    >> > wrote:
    >> >> In article <>,
    >> >> Tsb <> wrote:
    >> >>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    >> >>> write my C program, and then just do like this.
    >> >>> #gcc MYFILE.NAME -o MYFILE.NAME
    >> >> You overwrote your source file with the compiled binary.

    >>
    >> > Now what do i have to do?

    >>
    >> type it in again...
    >>

    >
    > I type it again. Then compile once and there still will be error.
    >
    > I want to execute my program many times.
    >
    > I am new in C, so I don't know clearly. If I want to use "#gcc
    > MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?


    This is really a question about your compiler, not about the C
    language, but the problem is common to most compilers.

    C source files are normally named with a ".c" suffix. For example:

    gcc myfile.c -o myfile

    If you have more questions about this, try gnu.gcc.help.

    <WAY_OFFTOPIC>
    The '#' prompt implies that you're probably running as root. Don't do
    that. You're making a mistake that destroys a single file; similar
    mistakes can easily damage your system. Use an ordinary user account
    unless you have a specific need for root privileges. If you have more
    questions about this, try comp.unix.questions.
    </WAY_OFFTOPIC>

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 12, 2007
    #10
  11. Tsb

    jacob navia Guest

    Keith Thompson wrote:
    > Tsb <> writes:
    >> On Oct 12, 2:23 pm, Ian Collins <> wrote:
    >>> Tsb wrote:
    >>>> On Oct 12, 2:14 pm, -cnrc.gc.ca (Walter Roberson)
    >>>> wrote:
    >>>>> In article <>,
    >>>>> Tsb <> wrote:
    >>>>>> Now I use FreeBSD 7.0 Current with Gnome. And I use Anjuta IDE to
    >>>>>> write my C program, and then just do like this.
    >>>>>> #gcc MYFILE.NAME -o MYFILE.NAME
    >>>>> You overwrote your source file with the compiled binary.
    >>>> Now what do i have to do?
    >>> type it in again...
    >>>

    >> I type it again. Then compile once and there still will be error.
    >>
    >> I want to execute my program many times.
    >>
    >> I am new in C, so I don't know clearly. If I want to use "#gcc
    >> MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?

    >
    > This is really a question about your compiler, not about the C
    > language, but the problem is common to most compilers.
    >

    Some. lcc-win will refuse an output file name that is identical to the
    input file name

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
    jacob navia, Oct 12, 2007
    #11
  12. On Fri, 12 Oct 2007 06:32:56 -0000, in comp.lang.c , Tsb
    <> wrote:

    >I type it again. Then compile once and there still will be error.
    >
    >I want to execute my program many times.
    >
    >I am new in C, so I don't know clearly. If I want to use "#gcc
    >MYFILE.NAME -o MYFILE.NAME " many times, what will I have to do?


    You need to read the instruction manual for gcc.


    --
    Mark McIntyre

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
    Mark McIntyre, Oct 12, 2007
    #12
  13. Tsb

    Guest

    On Oct 12, 11:15 am, jacob navia <> wrote:
    > Some. lcc-win will refuse an output file name that is identical to the
    > input file name


    Indeed, but lcc-win is a horrible C compiler.
    , Oct 16, 2007
    #13
  14. Tsb

    jacob navia Guest

    wrote:
    > On Oct 12, 11:15 am, jacob navia <> wrote:
    >> Some. lcc-win will refuse an output file name that is identical to the
    >> input file name

    >
    > Indeed, but lcc-win is a horrible C compiler.
    >


    Obviously

    I should erase the source file as gcc does.

    :)

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
    jacob navia, Oct 16, 2007
    #14
  15. writes:
    > On Oct 12, 11:15 am, jacob navia <> wrote:
    >> Some. lcc-win will refuse an output file name that is identical to the
    >> input file name

    >
    > Indeed, but lcc-win is a horrible C compiler.


    Surely there's enough *constructive* criticism available that
    meaningless insults are unnecessary.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 16, 2007
    #15
  16. In article <>,
    Keith Thompson <> wrote:
    > writes:
    >> On Oct 12, 11:15 am, jacob navia <> wrote:
    >>> Some. lcc-win will refuse an output file name that is identical to the
    >>> input file name

    >>
    >> Indeed, but lcc-win is a horrible C compiler.

    >
    >Surely there's enough *constructive* criticism available that
    >meaningless insults are unnecessary.


    Meaningless insults are what this ng is all about.
    Surely you've been around long enough to know that.
    Kenny McCormack, Oct 16, 2007
    #16
  17. On Tue, 16 Oct 2007 11:21:07 +0000, Kenny McCormack wrote:

    > In article <>, Keith Thompson
    > <> wrote:
    >> writes:
    >>> On Oct 12, 11:15 am, jacob navia <> wrote:
    >>>> Some. lcc-win will refuse an output file name that is identical to
    >>>> the input file name
    >>>
    >>> Indeed, but lcc-win is a horrible C compiler.

    >>
    >>Surely there's enough *constructive* criticism available that
    >>meaningless insults are unnecessary.

    >
    > Meaningless insults are what this ng is all about. Surely you've been
    > around long enough to know that.


    Funny, in the years I've been following it, it's been about C - despite
    endless attempts by some folks to expand that into other areas -
    Windows. Algorithm analysis. Gardening. Whatever.
    Kelsey Bjarnason, Oct 16, 2007
    #17
  18. "jacob navia" <> a écrit dans le message de news:
    47147a79$0$27387$...
    > wrote:
    >> On Oct 12, 11:15 am, jacob navia <> wrote:
    >>> Some. lcc-win will refuse an output file name that is identical to the
    >>> input file name

    >>
    >> Indeed, but lcc-win is a horrible C compiler.


    is ``horrible C'' a new dialect of C ?
    or are you proposing a name for C with lcc-win32 extensions ?

    > Obviously
    >
    > I should erase the source file as gcc does.


    No, IMHO, you should publish the source, as is done for gcc and lcc.

    > :)


    Indeed.

    --
    Chqrlie.
    Charlie Gordon, Oct 16, 2007
    #18
  19. Tsb

    Richard Guest

    "Charlie Gordon" <> writes:

    > "jacob navia" <> a écrit dans le message de news:
    > 47147a79$0$27387$...
    >> wrote:
    >>> On Oct 12, 11:15 am, jacob navia <> wrote:
    >>>> Some. lcc-win will refuse an output file name that is identical to the
    >>>> input file name
    >>>
    >>> Indeed, but lcc-win is a horrible C compiler.

    >
    > is ``horrible C'' a new dialect of C ?
    > or are you proposing a name for C with lcc-win32 extensions ?
    >
    >> Obviously
    >>
    >> I should erase the source file as gcc does.

    >
    > No, IMHO, you should publish the source, as is done for gcc and lcc.


    IMO he should do what the hell he wants with it.

    >
    >> :)

    >
    > Indeed.


    Saying "Indeed" doesn't make you a Heathfield clone you know.
    Richard, Oct 16, 2007
    #19
  20. Tsb

    jacob navia Guest

    Charlie Gordon wrote:
    > "jacob navia" <> a écrit dans le message de news:
    > 47147a79$0$27387$...
    >> wrote:
    >>> On Oct 12, 11:15 am, jacob navia <> wrote:
    >>>> Some. lcc-win will refuse an output file name that is identical to the
    >>>> input file name
    >>> Indeed, but lcc-win is a horrible C compiler.

    >
    > is ``horrible C'' a new dialect of C ?
    > or are you proposing a name for C with lcc-win32 extensions ?
    >
    >> Obviously
    >>
    >> I should erase the source file as gcc does.

    >
    > No, IMHO, you should publish the source, as is done for gcc and lcc.
    >
    >> :)

    >
    > Indeed.
    >


    Do *you* Charlie?

    Please let me have all your work for the last 12 years for free!
    And please give me all the products your company sells for free too.

    All source code, documentation, etc, so that I can use it without paying
    you a penny.

    Of course you will not pay me the money *I paid* for the
    source of lcc. That is my problem of course, not yours.

    I remember that you told that you sell compilers. I *can*
    imagine that having the source code of a compiler could
    help you make some money...

    But I am sorry, I will sell my product myself.

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
    jacob navia, Oct 16, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan
    Replies:
    0
    Views:
    1,107
  2. Ram
    Replies:
    0
    Views:
    2,805
  3. Replies:
    8
    Views:
    404
  4. grundmann
    Replies:
    8
    Views:
    338
    grundmann
    Sep 24, 2005
  5. J Cook

    Strange gcc compiler error?

    J Cook, May 3, 2011, in forum: C++
    Replies:
    6
    Views:
    259
    James Kanze
    May 3, 2011
Loading...

Share This Page