Results 1 to 7 of 7

Thread: A build problem in Qt creator 1

  1. #1
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default A build problem in Qt creator 1

    Hi pals
    I just installed Qt on windows XP and to become familiar with the details of Qt creator c++ programming, I wrote this code:
    Qt Code:
    1. #include "test.h"
    2. #include <conio.h>
    3. #include <iostream.h>
    4. void main(){
    5. int x;
    6. cin>>x;
    7. cout<<x*x;
    8. getch();}
    To copy to clipboard, switch view to plain text mode 
    but when i clicked on build menu,all icons were disabled.I saved the file but there was still no answer.
    and one more thing.
    in Qt creator code editing page,there is a wavy line under the #include lines.
    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A build problem in Qt creator 1

    Did you start a new project?

    About the wavy lines - hover your mouse cursor over them to see what the problem is (if the line is green, it means the parser can't find the files you are trying to include).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A build problem in Qt creator 1

    No there is no project.
    and you know,it should be able to find conio.h and iostream.h,shouldn't it?
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  4. #4
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: A build problem in Qt creator 1

    no it shouldn't find iostream.h since its been deprecated for more than 10 years iirc. and should be using #include <iostream> and #include <cconio>
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A build problem in Qt creator 1

    Quote Originally Posted by Dante View Post
    No there is no project.
    Then start one.
    and you know,it should be able to find conio.h and iostream.h,shouldn't it?
    And how should it know where to look for them if it doesn't even know where the compiler is installed and what compiler you are going to use?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A build problem in Qt creator 1

    So you mean it compiles just the files that are part of a project not a single source file?
    and could you tell me how to set the compiler ?
    and what is the error below:
    :-1: error: collect2: ld returned 1 exit status
    thanks
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A build problem in Qt creator 1

    Quote Originally Posted by Dante View Post
    So you mean it compiles just the files that are part of a project not a single source file?
    Creator is not trying to be smarter than its user, how should it know how to compile a standalone file? What if you gave it an SQL file, what should it do with it? What platform should it try to compile it for and using what compiler?

    and could you tell me how to set the compiler ?
    If you start a qmake project, qmake will create a proper Makefile for you. Just start a new project and the wizard will guide you.
    and what is the error below:
    Linker couldn't find some library it wanted to link your application against. Hard to say what the problem was, you'd have to paste the first error message, not the last one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Custom Plugin problem to build
    By brevleq in forum Qt Programming
    Replies: 10
    Last Post: 21st December 2008, 18:41
  2. Problem to build poppler under Windows
    By Lykurg in forum Installation and Deployment
    Replies: 0
    Last Post: 12th November 2008, 18:35
  3. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 10:12
  4. Build error on mac Platform::WaitMouseMoved
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2007, 14:18
  5. problem after Qt 4.2.2 static build
    By npc in forum Newbie
    Replies: 2
    Last Post: 23rd February 2007, 13:28

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.