Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. My first console C++ program on Qt Creator
QtWS25 Last Chance

My first console C++ program on Qt Creator

Scheduled Pinned Locked Moved Solved General and Desktop
35 Posts 6 Posters 9.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J JKSH
    21 Jan 2019, 23:47

    @tomy said in My first console C++ program on Qt Creator:

    Why does the IDE think I'm C coding while I explicitly told it by choosing "plain C++" that I would be coding on C++?

    I don't know. It works fine for me on Windows.

    It might be related to your Kit settings (this is just a guess).

    T Offline
    T Offline
    tomy
    wrote on 22 Jan 2019, 10:03 last edited by
    #25

    @JKSH
    Kids are only the Desktop kit:

    0_1548151415171_1.png

    By the way, I'm on Linux. Have you tried a plain C++ project on Linux to see if there are those red underlines or not?

    C J 2 Replies Last reply 22 Jan 2019, 13:32
    0
    • T tomy
      22 Jan 2019, 10:03

      @JKSH
      Kids are only the Desktop kit:

      0_1548151415171_1.png

      By the way, I'm on Linux. Have you tried a plain C++ project on Linux to see if there are those red underlines or not?

      C Offline
      C Offline
      Cobra91151
      wrote on 22 Jan 2019, 13:32 last edited by
      #26

      @tomy

      Hi! I think the problem is with your compiler, try setting it as g++ not gcc.

      For example, using MinGW on Windows (compiler path is ....\g++.exe):

      0_1548163802423_2019-01-22_152922.png

      T 1 Reply Last reply 22 Jan 2019, 20:39
      1
      • T tomy
        22 Jan 2019, 10:03

        @JKSH
        Kids are only the Desktop kit:

        0_1548151415171_1.png

        By the way, I'm on Linux. Have you tried a plain C++ project on Linux to see if there are those red underlines or not?

        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 22 Jan 2019, 15:12 last edited by
        #27

        @tomy said in My first console C++ program on Qt Creator:

        By the way, I'm on Linux. Have you tried a plain C++ project on Linux to see if there are those red underlines or not?

        Unfortunately, I don't have a Linux machine with a recent version of Qt and Qt Creator.

        One thing you could try is to create a Qt Console Application, then remove Qt from the .pro file.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • C Cobra91151
          22 Jan 2019, 13:32

          @tomy

          Hi! I think the problem is with your compiler, try setting it as g++ not gcc.

          For example, using MinGW on Windows (compiler path is ....\g++.exe):

          0_1548163802423_2019-01-22_152922.png

          T Offline
          T Offline
          tomy
          wrote on 22 Jan 2019, 20:39 last edited by
          #28

          @Cobra91151
          Is it on Linux, please?
          The options are different between Windows and Linux.

          C 1 Reply Last reply 22 Jan 2019, 20:46
          0
          • T tomy
            22 Jan 2019, 20:39

            @Cobra91151
            Is it on Linux, please?
            The options are different between Windows and Linux.

            C Offline
            C Offline
            Cobra91151
            wrote on 22 Jan 2019, 20:46 last edited by Cobra91151
            #29

            @tomy

            I don't think that Qt Creator is different on Linux and Windows. Check: Tools -> Options -> Kits -> Compilers. Then select your compiler and click Browse. Your compiler should be "..\g++.exe" or something similar to it. Check if it's available for you.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tomy
              wrote on 22 Jan 2019, 22:14 last edited by
              #30

              There is no g++ unfortunately.

              0_1548195294218_1.png

              C 1 Reply Last reply 23 Jan 2019, 10:44
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 22 Jan 2019, 22:16 last edited by
                #31

                Do you mean you only have gcc installed ?
                In that case, install g++.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                T 1 Reply Last reply 22 Jan 2019, 22:21
                0
                • S SGaist
                  22 Jan 2019, 22:16

                  Do you mean you only have gcc installed ?
                  In that case, install g++.

                  T Offline
                  T Offline
                  tomy
                  wrote on 22 Jan 2019, 22:21 last edited by
                  #32

                  @SGaist
                  I've that installed in its newest version on the machine.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 22 Jan 2019, 22:23 last edited by
                    #33

                    Can you show what the kit you are using looks like ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • T tomy
                      22 Jan 2019, 22:14

                      There is no g++ unfortunately.

                      0_1548195294218_1.png

                      C Offline
                      C Offline
                      Cobra91151
                      wrote on 23 Jan 2019, 10:44 last edited by
                      #34

                      @tomy said in My first console C++ program on Qt Creator:

                      There is no g++ unfortunately.

                      0_1548195294218_1.png

                      If you have it installed, click the Add button to navigate and add the g++ compiler to Qt Creator.

                      Note:
                      Make sure you know the path to g++ compiler on your system.

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tomy
                        wrote on 23 Jan 2019, 12:43 last edited by
                        #35

                        Thanks so much to you both.
                        The problem was with the kits. I defined gcc for the C++ compiler and it removed the redundant stuff from the code.

                        1 Reply Last reply
                        3

                        34/35

                        23 Jan 2019, 10:44

                        • Login

                        • Login or register to search.
                        34 out of 35
                        • First post
                          34/35
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved