Results 1 to 7 of 7

Thread: QT Creator Unable to find STL outside of project, Bad install?

  1. #1
    Join Date
    Oct 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Android

    Default QT Creator Unable to find STL outside of project, Bad install?

    Hello,
    I am new to C++ programming.
    I was trying to write a simple hello world program.
    I created a New File/C++ Source File...
    Then I attempted to use includes from the STL

    Qt Code:
    1. // Game1
    2. //
    3. // Demonstrates constants
    4.  
    5. #include <iostream>
    6. using namespace std;
    7. ...
    To copy to clipboard, switch view to plain text mode 

    The: "include <iostream>" is always listed (highlighted) as an error. Why is this only happening here but not when I create a project?
    Is there something wrong with my install?

    Thanks in advance,
    Last edited by anda_skoa; 29th October 2016 at 08:11.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator Unable to find STL outside of project, Bad install?

    What does "hightlighted" mean?
    In an editor? Or do you get a build error?

    Cheers,
    _

  3. #3
    Join Date
    Oct 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Android

    Default Re: QT Creator Unable to find STL outside of project, Bad install?


    Thanks for the reply!
    :-)

    When I hi-light the error it says :

    iostream:No Such File or Directory
    It will not allow me to build or run the code.
    The complete program is here:

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

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator Unable to find STL outside of project, Bad install?

    What is the content of your project's .pro file?

    Cheers,
    _

  5. #5
    Join Date
    Oct 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Android

    Default Re: QT Creator Unable to find STL outside of project, Bad install?

    Quote Originally Posted by anda_skoa View Post
    What is the content of your project's .pro file?

    Cheers,
    _
    Where do I find the .pro file?

  6. #6
    Join Date
    Oct 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Android

    Default Re: QT Creator Unable to find STL outside of project, Bad install?

    Quote Originally Posted by anda_skoa View Post
    What is the content of your project's .pro file?

    Cheers,
    _
    There is no .pro file as I was attempting to write a single program and it is not part of a project. Is my thinking on this wrong?

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator Unable to find STL outside of project, Bad install?

    If you are not using qmake to generate the build files, are you using something else or are you manually writing a Makefile?
    Or are you typing the compiler invocation manually in a shell?
    You need to build the program somehow :-)

    Cheers,
    _

Similar Threads

  1. Qt Creator: Unable to build any project
    By MartijnKor in forum Qt Tools
    Replies: 3
    Last Post: 9th June 2016, 07:15
  2. Replies: 10
    Last Post: 16th June 2014, 15:40
  3. Replies: 2
    Last Post: 22nd November 2011, 00:09
  4. Unable to install QCA
    By viv_asp in forum Installation and Deployment
    Replies: 2
    Last Post: 30th January 2011, 07:28
  5. Replies: 18
    Last Post: 21st May 2010, 15:08

Tags for this Thread

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.