Results 1 to 8 of 8

Thread: project plain c++ without qt library

  1. #1
    Join Date
    May 2013
    Posts
    12
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default project plain c++ without qt library

    when i try to make this project it works normal, but nothing appears in the console window. i can ´t show a simple cout<<"hello world". someone knows what's happening?
    i newbie i qt creator...
    Last edited by crisHerald; 20th May 2013 at 11:50.
    Cristiano Araujo

    Design and programming are human activities; forget that and all is lost.
    Stroustrup, Bjarne

  2. #2
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: project plain c++ without qt library

    can you post the contents of your .pro file & main.cpp file

  3. #3
    Join Date
    May 2013
    Posts
    12
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: project plain c++ without qt library

    Qt Code:
    1. #include <iostream>
    2.  
    3. using namespace std;
    4.  
    5. int main()
    6. {
    7. cout << "Hello World!" << endl;
    8. return 0;
    9. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += console
    3. CONFIG -= qt
    4.  
    5. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    but when i try the same on windows 7 it works fine! i don know what's happening!
    Cristiano Araujo

    Design and programming are human activities; forget that and all is lost.
    Stroustrup, Bjarne

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: project plain c++ without qt library

    What you have there is the generic, wizard-created "Non Qt-project, Plain C++" program.

    I am assuming your first attempt was on a Linux box.

    If you are running the program from inside Qt Creator then there are two possible places the output is going:
    • Into a terminal window that pops up, shows your program output, and waits for you to "Press <RETURN> to close this window...". This is the default created by the wizard.
    • Into the "Application Output" pane if the "Run in terminal" option is off. Find this option in Projects, Build & Run, Run settings.


    Some terminal programs have an issue with being used in Qt Creator (e.g. KDE konsole) and, of course, one needs to be installed. Under Tools menu, Options, Environment, General tab check the "Terminal" settings. It is probably "xterm -e". If so, check that you have xterm installed or launching your program with it will fail with an error in the Program Output pane.

  5. #5
    Join Date
    May 2013
    Posts
    12
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: project plain c++ without qt library

    Screenshot from 2013-05-21 11:37:59.jpg

    screenshot
    nothing appears on console .

    only the cursor's mouse
    Cristiano Araujo

    Design and programming are human activities; forget that and all is lost.
    Stroustrup, Bjarne

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: project plain c++ without qt library

    Quote Originally Posted by Me
    Some terminal programs have an issue with being used in Qt Creator (e.g. KDE konsole) and, of course, one needs to be installed. Under Tools menu, Options, Environment, General tab check the "Terminal" settings. It is probably "xterm -e". If so, check that you have xterm installed or launching your program with it will fail with an error in the Program Output pane.
    I guess whatever Ubuntu is using as a terminal ("Terminal") is similarly afflicted. Change it to "xterm -e" and install xterm, or set the project to not run in a terminal as described above.
    Last edited by ChrisW67; 21st May 2013 at 22:51.

  7. #7
    Join Date
    May 2013
    Posts
    12
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: project plain c++ without qt library

    i have this istalled:

    x-terminal-emulator -e

    is the right terminal? how can i download the right?
    Cristiano Araujo

    Design and programming are human activities; forget that and all is lost.
    Stroustrup, Bjarne

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: project plain c++ without qt library

    Replace that with:
    Qt Code:
    1. xterm -e
    To copy to clipboard, switch view to plain text mode 
    If nothing happens because xterm is not installed:
    Qt Code:
    1. sudo apt-get install xterm
    To copy to clipboard, switch view to plain text mode 
    Or use whatever Ubuntu's graphical package manager is to do the same thing.

    Then find a Ubuntu beginners' guide and read some of it.
    http://ubuntu-manual.org/
    http://www.ubuntupocketguide.com/

  9. The following user says thank you to ChrisW67 for this useful post:

    crisHerald (23rd May 2013)

Similar Threads

  1. Replies: 9
    Last Post: 20th April 2013, 22:58
  2. Qt Creator Plain C++ Project won't run/debug...
    By jiapei100 in forum Qt Programming
    Replies: 9
    Last Post: 26th July 2012, 18:09
  3. Replies: 4
    Last Post: 18th December 2009, 18:55
  4. How do to add a library to my project?
    By N3wb in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2009, 06:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.