LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2003, 09:10 PM   #1
necromancer
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat 8
Posts: 5

Rep: Reputation: 0
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
 
Old 03-01-2003, 05:09 AM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
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
 
Old 03-03-2003, 04:56 AM   #3
necromancer
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat 8
Posts: 5

Original Poster
Rep: Reputation: 0
i tried doing what you said but still the problems are still there
 
Old 03-03-2003, 07:20 AM   #4
finidi
Member
 
Registered: Dec 2002
Location: World
Distribution: Fedora Core 4
Posts: 127

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

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

HTH
 
Old 03-03-2003, 07:23 AM   #5
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Replace those double quotes with real double quotes. Should be ascii character 34.
 
Old 03-03-2003, 11:00 PM   #6
necromancer
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat 8
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 03-04-2003, 02:13 AM   #7
necromancer
LQ Newbie
 
Registered: Feb 2003
Distribution: Redhat 8
Posts: 5

Original Poster
Rep: Reputation: 0
do not worry i have figured it out! hoorah!

i just has to press alt + shift + "

thanks a lot for your help!
 
Old 03-04-2003, 01:04 PM   #8
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved Problem Second GCC-Pass(or gettext sanity check problem) hoes Linux From Scratch 0 09-04-2005 10:20 AM
gcc problem skguha Linux - Software 3 05-06-2004 07:03 AM
problem with gcc ptwobrussell Linux - Software 4 09-08-2003 04:58 PM
gcc problem chief Linux - Software 2 07-24-2003 04:23 PM
gcc 3.3 problem darthczyz Linux - Software 6 05-20-2003 10:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration