cancel
Showing results for 
Search instead for 
Did you mean: 

c under linux

SOLVED
Go to solution
Vinayak_HPUX
Frequent Advisor

c under linux

NOT ABLE TO COMPILE simple c program in FC8 linux ??
[root@linuxguru.symantec.com][ /usr/src/redhat/SOURCES ]gcc abc.cc
abc.cc:10: error: stray ‘\342’ in program
abc.cc:10: error: stray ‘\200’ in program
abc.cc:10: error: stray ‘\234’ in program
abc.cc:10: error: stray ‘\’ in program
abc.cc:10: error: stray ‘\342’ in program
abc.cc:10: error: stray ‘\200’ in program
abc.cc:10: error: stray ‘\235’ in program
abc.cc: In function ‘int main()’:
abc.cc:10: error: ‘Hello’ was not declared in this scope
abc.cc:10: error: ‘Linux’ was not declared in this scope
[root@linuxguru.symantec.com][ /usr/src/redhat/SOURCES ]rm abc.c
rm: remove regular file `abc.c'? y
[root@linuxguru.symantec.com][ /usr/src/redhat/SOURCES ]

* hello.c – Canonical “Hello, world!” program 4 4 */
#include
int main(void)
{
fprintf(stdout, “Hello, Linux programming world!\n”);
return 0;
}
gcc is installed but not able to compile c code ..need help?
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
5 REPLIES
Torsten.
Acclaimed Contributor
Solution

Re: c under linux

Not sure why you are asking a linux related question in hp-ux land, but if this is your source code - how do you write comments?

/*
not only
*

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Vinayak_HPUX
Frequent Advisor

Re: c under linux

#include
#include
#include
#include
#include
#include
#include
int main(void)
{
fprintf(stdout, â Hello, Linux programming world!\nâ );
return 0;
}

have a this code
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
Steven Schweda
Honored Contributor

Re: c under linux

Try using simple ASCII quotation marks,
instead of whatever complicated,
good-looking (I'm sure), exotically-coded
junk you have in there.

What are you using as an editor, Microsoft
Word?
Rob Leadbeater
Honored Contributor

Re: c under linux

Hi,

I'll guess that you've cut and pasted some code, and managed to include some invisible control sequences in your source code...

Cheers,

Rob
Vinayak_HPUX
Frequent Advisor

Re: c under linux

ok bye
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "