LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2006, 06:03 PM   #1
maxisold
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
C++ "not declared" errors


I try to compile a "hello world" C++ program and i get a ton of errors such as:
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/cstdlib:114: error: `::strtol' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/cstdlib:115: error: `::strtoul' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/cstdlib:116: error: `::system' has not been declared
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/cstdlib:118: error: `::wcstombs' has not been declared
thanks for your help!

the code is:
int main ()
{

std:: cout << "hi, I'm john"
return 0;
}

it was copied straight from a book. i had tried the #include <iostream>, but this did not work either.
thanks

here is my new code with the same results:
//#include <string>
#include <iostream>
//#include <stdio.h>

int main ()
{

std::cout << "hi, I'm john";
return 0;
}

i have tried to reinstall, but rpm tells me it is there. i have tried G++ and gcc and with both i get the same results.

Last edited by maxisold; 09-10-2006 at 06:33 PM.
 
Old 09-10-2006, 06:16 PM   #2
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
post your "hello word" code.
 
Old 09-10-2006, 06:22 PM   #3
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Quote:
the code is:
int main ()
{

std:: cout << "hi, I'm john"
return 0;
}

...

Last edited by maxisold : Today at 03:20 PM.
You need to #include <iostream>

You're missing a semicolon after "hi, I'm john"

There shoud be no space between :: and cout.

Last edited by zhangmaike; 09-10-2006 at 06:24 PM.
 
Old 09-10-2006, 07:09 PM   #4
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Please make a new post for your responce instead of editing your original, your confusing me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 03:07 PM
"NIM thread blocked" & "Deadman Switch" errors sosborne AIX 3 06-01-2006 12:21 PM
Constant errors during "make" or "make install" with SUSE 10.1 Alpha 4 TehFlyingDutchman Linux - Software 3 12-30-2005 07:25 PM
FC4 install errors, "diabling IRQ #10" "nobody cares" error message??? A6Quattro Fedora 6 07-20-2005 01:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:19 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration