wrnash wrote:

Hello,



I?m trying to learn to program in c++. I bought a book and I install the software on a windows machine and was able to run my first program. Now I would like to run this on a linux mandrake 9.0 machine. I do not know how to do this. This is the program I use from the book.


#include<iostream>


int main()

{

std::cout<<?Hello, new world!\n?;

}

Sorry if this is the wrong newsgroup.

Probably, but since you're here...




I type the following and I get a error

Gcc hello.cpp

In general, it would be helpful if you report the specific error, as well as the version of gcc you are using (gcc --version should tell you).

When I try this on Mandrake 8.1, gcc 2.96, I get errors from the linker, ld, about undefined references to cout and ostream::operator<<. However, if I type

g++ hello.cpp

it compiles and runs fine. It likes like gcc (2.96 at least) doesn't assume from the filename extension that you are compiling C++ rather than C (or at least doesn't automatically link with the proper libraries). I'm rather surprised at that, but anyway try using g++ and see if that works.


Is there a program I can use like visual c++ 6.0 under linux.

I'm not so familiar with C++ integrated development environments for Linux, so I'll have to let someone else answer that.



Thanks Bill Nash





Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to