Failling Qt application on Ubuntu
<p>I have Ubuntu 10.04 and have the Qt library install. When I run the code</p>

<pre><code>#include &lt;QDir&gt;
#include &lt;QFileInfo&gt;

#include &lt;QtDebug&gt;

int main( int argc, char **argv )
{
    foreach( QFileInfo drive, QDir::drives() )
    {
        qDebug() &lt;&lt; "Drive: " &lt;&lt; drive.absolutePath();

        QDir dir = drive.dir();
        dir.setFilter( QDir::Dirs );

        foreach( QFileInfo rootDirs, dir.entryInfoList() )
            qDebug() &lt;&lt; "  " &lt;&lt; rootDirs.fileName();
    }

    return 0;
}
</code></pre>

<p>I get the following errors.</p>

<pre><code>g++ qt.cpp -o test
qt.cpp:1:16: error: QDir: No such file or directory
qt.cpp:2:21: error: QFileInfo: No such file or directory
qt.cpp:4:19: error: QtDebug: No such file or directory
qt.cpp: In function ‘int main(int, char**)’:
qt.cpp:8: error: ‘QFileInfo’ was not declared in this scope
qt.cpp:8: error: ‘QDir’ has not been declared
qt.cpp:8: error: ‘foreach’ was not declared in this scope
qt.cpp:9: error: expected ‘;’ before ‘{’ token
</code></pre>

<p>How do I fix this problem?</p>
