LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gcc 3.2-7 problem (https://www.linuxquestions.org/questions/programming-9/gcc-3-2-7-problem-47679/)

necromancer 02-28-2003 09:10 PM

gcc 3.2-7 problem
 
i have a problem, i recently installed redhat 8 and i was testing the g++ compiler, i used the basic hello world program,

#include <iostream>


int main()
{
std::cout << ¨Hello World¨ << std::endl;
return 0;
}

when i compile i get this error;

0.0.cpp: In function `int main()':
0.0.cpp:6: stray '\302' in program
0.0.cpp:6: stray '\250' in program
0.0.cpp:6: stray '\302' in program
0.0.cpp:6: stray '\250' in program
0.0.cpp:6: `Hello' undeclared (first use this function)
0.0.cpp:6: (Each undeclared identifier is reported only once for each function
it appears in.)
0.0.cpp:6: parse error before `<<' token

i believe it is not locating the header files which are in /usr/include/c++/3.2

can some one please help me resolve this problem?



BTW: all development packages are installed

llama_meme 03-01-2003 05:09 AM

Sounds like you have some (unprintable) non-ASCII chracters in your program's text. Easiest thing to do (with such a short program) is to open a new file, retype it, and see if it works after that.

Alex

necromancer 03-03-2003 04:56 AM

i tried doing what you said but still the problems are still there :cry:

finidi 03-03-2003 07:20 AM

I'm not sure, but your problem seems to be analog to :

http://www.linuxquestions.org/questi...threadid=45955

HTH

Mik 03-03-2003 07:23 AM

Replace those double quotes with real double quotes. Should be ascii character 34.

necromancer 03-03-2003 11:00 PM

i copy and pasted some code from a site the same hello world program and eureka! it worked, so it is an ascii problem.

so anyway to resolve the ascii problem?

necromancer 03-04-2003 02:13 AM

do not worry i have figured it out! hoorah! :D ;)

i just has to press alt + shift + "

thanks a lot for your help! :)

llama_meme 03-04-2003 01:04 PM

Hmm, you shouldn't have to do that. Maybe you're using the wrong keyboard map or something? Or a dodgy editor (less likely).

Alex


All times are GMT -5. The time now is 09:57 AM.