The '-l' option to gcc and g++ is sent to the linker and tells the linker what libraries you want to link against. If your program has any symbols (references) in it to things like QString (a Qt class) the linker will complain that it can't resolve the symbol. When you add the proper -l options the linker will find it in the appropriate library.
-lqt tells the linker you want to link against the library found in the file libqt.so (might have some numbers for versioning after the .so). If you don't have a that file the linker will tell you it can't find it. This should be provided by the "libqt" package (or something similar, I don't use Qt myself). The *-dev packages have the header files in them (the things used by the #include parts of a program). If those are missing you get a different error much earlier. You don't need the -dev package to _link_ the program if you already have object files (*.o). (You do need them for a comlete compile from source) To solve your problem I would suggest trying to find libqt.so and make sure you have the Qt package(s) installed. HTH, -D PS. I know the above was probably a bit confusing. C/C++ compilation has several stages, and there are a lot of details related to each one. There are a lot of details I don't know.