Jump to content

Mandrake 9.0 probs - g++ can't find std??


Guest murl
 Share

Recommended Posts

Hi all...

 

I just installed mdk 9.0, and tried to compile some simple c++ code:

 

[jon@brainfart jon]$ cat temp.cpp

#include <string>

 

using namespace std;

 

int main(void){

string joe;

 

joe = "hi";

std::cout << joe << std::endl;

}

 

When I try to compile, I get this error:

 

[jon@brainfart jon]$ g++ temp.cpp

temp.cpp: In function `int main()':

temp.cpp:9: `cout' undeclared in namespace `std'

temp.cpp:9: `endl' undeclared in namespace `std'

 

WTF is going on? Am I missing something? I installed pretty much all the development libs, so I dont know what I'm missing.

 

Thanks!

Link to comment
Share on other sites

nahh, that's not the prob, that syntax is ok...

 

It compiles fine on my redhat 7.1 box...

 

I have no clue why it's doing this! Seems like there's a prob with where mdk installs gcc or something??

Link to comment
Share on other sites

Try including string.h instead of just string. Namespace std, last I checked, meant you didn't have to put the .h at the end... But then again, my teacher was Korean, so I couldn't understand her.

Link to comment
Share on other sites

  • 3 weeks later...
Guest christof

I have the same problem when Compiling anything. But there again.. I am totally new to Linux...

my box is running on Mandrake 9 too and I get the error messages: STD not found and gtk not found.

the prolem is: I did install all teh development packages available on Mandrake... :-/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...