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 |
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 |
i tried doing what you said but still the problems are still there :cry:
|
I'm not sure, but your problem seems to be analog to :
http://www.linuxquestions.org/questi...threadid=45955 HTH |
Replace those double quotes with real double quotes. Should be ascii character 34.
|
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? |
do not worry i have figured it out! hoorah! :D ;)
i just has to press alt + shift + " thanks a lot for your help! :) |
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. |