Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:50:48+00:00 2026-06-04T04:50:48+00:00

I am writing this simple Qt application, but it is showing the following errors.

  • 0

I am writing this simple Qt application, but it is showing the following errors.
Can anyone explain me why I am getting these errors? Below is the code snippet:

#include <QTextStream>

int main()
{
   QTextStream out(stdout);
   out << "console application\n";
}

Steps followed to compile:

qmake -project 
qmake .pro file 
make 

After following the above mentioned steps, below is the output that I’m getting:

g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o text.o text.cpp
text.cpp:1:23: error: QTextStream: No such file or directory
text.cpp: In function ‘int main()’:
text.cpp:5: error: ‘QTextStream’ was not declared in this scope
text.cpp:5: error: expected ‘;’ before ‘out’
text.cpp:6: error: ‘out’ was not declared in this scope
make: *** [text.o] Error 1

Platform: Linux

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:50:49+00:00Added an answer on June 4, 2026 at 4:50 am

    Use qmake and make instead of manually invoking the compiler.

    cd YourProject/
    qmake -project
    qmake
    make
    ./YourProjectTarget
    

    and make sure the qmake version you’re invoking is the Qt4 version, not the Qt3. You seem to have both versions installed, and you’re probably invoking the Qt3 one.

    Try this:

    qmake -version
    

    The output should be something like this

    QMake version 2.01a
    Using Qt version 4.8.1 in /usr/lib/x86_64-linux-gnu
    

    To be sure you’re invoking the right qmake (Qt4), usually you can replace qmake commands with qmake-qtX, where X is the Qt version.

    cd YourProject/
    qmake-qt4 -project
    qmake-qt4
    make
    ./YourProjectTarget
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a simple answer, but I am having some issues writing this
What I'm trying to do this is writing a simple parser for the following
I am writing a fairly simple Django application where users can enter string queries.
I am considering writing a simple database application for my wife, but I'm hung
I am writing this small code which is part of my Django application. It
I am writing a simple application using the Facebook iPhone SDK. The Facebook code
So I was writing this simple program to calculate the day of any date
Is this a simple process? I'm only writing a quick hacky UI for an
I am writing a simple batch file and i get this The syntax of
I am writing a simple keylogger program (for non-malicious purposes). Note: This is with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.