G++ includes and linkers

Im fairly new to c++ programming and Im getting to the point now that I want to use some of the libraries included in suse with my programs, but I can’t figure out the includes and linkers options when you compile. I usually compile from the shell instead of using a development environment like netbeans or something like that.

Here’s examples of a compile that didn’t work.
g++ -0 current test.cpp -L/usr/include/qt4/lib -I/usr/include/qt4/include -lqt4
g++ -0 current test.cpp -L/usr/include/qt4/lib -I/usr/include/qt4/include -l/usr/include/qt4

In both cases I get an error cannot find -lqt4 or cannot find -l/usr/include/qt4.

I think my real problem is that I have not found a real good nuts and bolts explanation of each of the options so Im not clear what Im doing wrong.

Do you have libqt4-devel installed?
The include dir for qt is /usr/include/Qt, /usr/include/QtCore,
/usr/include/QtGui …
There is no such thing as -lqt4 (this would link against a library
libqt4.so or libqt4.a which does not exist)
The libraries are named


libQt3Support.so     libQtDesignerComponents.so  libQtNetwork.so
libQtSvg.so
libQtCLucene.so      libQtDesigner.so            libQtOpenGL.so
libQtTest.so
libQtCore.so         libQtGui.so                 libQtScript.so
libQtWebKit.so
libQtDBus.so         libQtHelp.so                libQtScriptTools.so
libQtXmlPatterns.so
libQtDeclarative.so  libQtMultimedia.so          libQtSql.so
libQtXml.so

and the corresponding link switch has hence to be
-lQtGui -lQtCore and so on.


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.4 |
nVidia ION | 3GB Ram