Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-26-2004, 08:35 PM   #1
Registered: Jan 2004
Posts: 53

Rep: Reputation: 15
#include<string> not working

Ok. I have Slackware 9.1, and I'm trying to install a program that I need for school. Only having a minor problem, and I tested it and isolated it down to this:


isn't actually #including anything when compiled with gcc. It doesn't give that as an error, but ANYWHERE I try to define a string as in:

string someStringHere;
Does anyone know where my string library is, or how to set it up so it gets included properly?
Old 03-26-2004, 08:52 PM   #2
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
I bet you're not including the line:
using namespace std;
just after your include statements. Either add that line or every time you declare a string, refer to it as:
so you end up with variable declarations like:
std::string mystring;

void stringfunction(std::string aVariable, int anInt){
       std::cout << aVariable << std::endl;
Old 03-26-2004, 09:00 PM   #3
Registered: Jan 2004
Posts: 53

Original Poster
Rep: Reputation: 15
Re: #include<string> not working

lol Yeah, that would be a newbie mistake, but using namespace std is in there. It'll actually be a massive pain if I can't just figure out why it's giving me these errors, seeing as the root of the problem is that I'm installing something. There's about 300 files being compiled by this weird series of makefiles. It's pretty messy, I sure didn't code it. I'd hate to have to go edit each of these files...but yeah, using namespace std is there. Any other ideas?

Last edited by dtjohnst; 03-26-2004 at 09:01 PM.


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
include/linux/types.h and include/linux/posix_types.h kpachopoulos Programming 2 11-26-2005 06:52 AM
PHP include() not working kodon Slackware 13 08-10-2004 07:05 AM
edit path environment variable to include current working directory alb1954 Linux - Newbie 8 07-12-2004 12:26 AM
java test if string in string array is null. exodist Programming 3 02-21-2004 02:39 PM
php include not working just dumping txt to screen timc3 Linux - Software 0 10-07-2003 06:46 PM > Forums > Linux Forums > Linux - Software

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

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