How to get started with C++

I want to get started with C++ programing, so I installed gcc and gcc-c++ packages and created a file test.cpp containing the following:

#include <iostream>
int main(){
	cout<<"Hello world!";
	return 0;
}

and in the terminal got the following output:

dean@dean-suse:~/C++> g++ test.cpp -o test
/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
dean@dean-suse:~/C++> gedit test.cpp
dean@dean-suse:~/C++> gcc test.cpp -o test
test.cpp:1:20: error: iostream: No such file or directory
test.cpp: In function ‘int main()’:
test.cpp:3: error: ‘cout’ was not declared in this scope

I started learning C++ while I was using Windows, but I have absolutely no experience with Linux compiling. Can anyone tell me where I can get the needed libraries to compile this simple program?

Hey there,

I just started learning C++ myself and here is a good tutorial:
[C++] Tutorial 1: The Basics](http://www.physicsforums.com/showthread.php?t=32703)

And this one is even better and more detailed:
C++ Language Tutorial

To compile C++ programs you need g++ installed and then run “g++ yourprogram.cpp -o yourprogram” to compile it. I can’t give any more information than this as I’m still a newbie in C++ myself.

Good luck & have fun!

Thanks, EarthMind. I’ve actually been through these tutorials in windows. The real problem is compiling.
I installed all packages in the “Base development” category and now it shows the following:

dean@dean-suse:~/C++> g++ test.cpp -o test
test.cpp: In function ‘int main()’:
test.cpp:3: error: ‘iostream’ was not declared in this scope
dean@dean-suse:~/C++> g++ test.cpp -o test
test.cpp: In function ‘int main()’:
test.cpp:3: error: ‘cout’ was not declared in this scope
dean@dean-suse:~/C++> 

any idea what that means?

Okay, figured it out! I forgot to put in
using namspace std;
and now it works.

Okay, I want to learn to use the qt library, but I can’t find the packages needed to use that. I try #include<qapplication> and qapplication.h, but it just doesn’t work, saying: “qapplication.h: No such file or directory”. Can anyonew help me?

Did you install the development file libqt4-devel? I think that is what you need.

Thanks, I installed it and now it works.

Good. Are you working with QT Designer for GUI or just a plain .cpp file?