GCC compiler error

T

Tsb

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?
 
T

Tsb

Or Should I use another compiler on FreeBSD? Which one is suitable for
beginners(like me) on FreeBSD ?
 
B

borkhuis

Tsb said:
On Oct 12, 2:14 pm, (e-mail address removed)-cnrc.gc.ca (Walter Roberson)
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?

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
 
R

Richard Bos

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
 
T

Tsb

Do not quote signatures, please.




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.
 
K

Keith Thompson

Tsb said:
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>
 
J

jacob navia

Keith said:
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
 
M

Mark McIntyre

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
 
K

Kenny McCormack

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.
 
K

Kelsey Bjarnason

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.
 
C

Charlie Gordon

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.
 
R

Richard

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


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.

Saying "Indeed" doesn't make you a Heathfield clone you know.
 
J

jacob navia

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


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top