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 05-31-2004, 02:30 PM   #1
harry349
LQ Newbie
 
Registered: Nov 2003
Posts: 19

Rep: Reputation: 0
simple g++ library path question


I don't program that often, but last time I used g++ in RedHat 7.2, I remember it working fine for my simple programs.

I'm now sitting at RedHat 9, and it complains about missing basic identifiers such as cout and endl, from iostream, which I am including.

I'm guessing that the LIBRARY_PATH needs to be configured properly, but I wasn't sure about some details.

1. Is the LIBRARY_PATH environment variable the best way to handle this?
2. Is it recursive? i.e. if I add "/usr/include", will things in "/usr/include/g++-3" also get found?
3. Any ideas why g++ or the library path wouldn't be set to these locations by default?

Thanks.
 
Old 05-31-2004, 02:38 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Do you have
Code:
using namespace std;
somewhere at the beginning of your code?
 
Old 05-31-2004, 03:11 PM   #3
harry349
LQ Newbie
 
Registered: Nov 2003
Posts: 19

Original Poster
Rep: Reputation: 0
Good question. I did not have it.

I was aware of but kind of forgot about namespaces; they didn't really exist back when I learned C++.

If I put "using namespace std;" after the includes (or put "std::" in front of the unknown identifiers) all is good. Thanks.
 
  


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
library path Scott7 Debian 1 10-19-2005 07:25 AM
library path variable vrdhananjay Linux - Software 2 09-03-2005 06:31 PM
How do I add library path? scc28y Linux - Newbie 5 03-18-2005 10:56 PM
GD Library path? kinkybullet Linux - Newbie 1 02-11-2004 09:15 PM
Cannot find path for library Baran Linux - Newbie 5 09-03-2003 04:46 AM

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

All times are GMT -5. The time now is 12:09 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