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. [Solved] I cant use "auto" keyword in Qt 5.1.2 into Ubuntu
QtWS25 Last Chance

[Solved] I cant use "auto" keyword in Qt 5.1.2 into Ubuntu

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 5.8k 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.
  • C Offline
    C Offline
    Charlie_Hdz
    wrote on 23 Mar 2014, 06:04 last edited by
    #1

    Hi.

    Im trying to develope in Qt (IDE and GUI) but all the time im found problems and now the actual problems is the type "Auto" defined in C++ 11.

    Now, i have typing the keyword auto for declare a iterator and in the time of debug the solution, Qt set me a problem:

    "auto" changes the meaning in C++ 11; please dont use it.

    Somebody can help me?

    Kind Regards,
    Enrique Hernandez
    gearstech.com.mx
    chernandez@gearstech.com.mx

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Eddy
      wrote on 23 Mar 2014, 06:55 last edited by
      #2

      Hi Charlie_Hdz,

      Did you add -std=c++11 or -std=gnu++11 in Qt Creator project settings?

      C++11 is not activated by default in Qt Creator.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Charlie_Hdz
        wrote on 23 Mar 2014, 07:02 last edited by
        #3

        Hi Eddy.

        I did it and works

        I add in .pro of the project CONFIG += c++11 and works.

        Thanks you :)

        Kind Regards,
        Enrique Hernandez
        gearstech.com.mx
        chernandez@gearstech.com.mx

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Eddy
          wrote on 23 Mar 2014, 09:06 last edited by
          #4

          Great

          Could you mark the thread as [Solved] please?

          happy coding

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 23 Mar 2014, 21:10 last edited by
            #5

            Hi,

            Just a little trick, when writing a post with pro file content also use the coding tags e.g.

            @CONFIG += c++11@

            Otherwise it's likely to get misinterpreted by the current text engine used. Your's look like CONFIG = c+11 even if it's written correctly.

            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
            • C Offline
              C Offline
              Charlie_Hdz
              wrote on 24 Mar 2014, 00:04 last edited by
              #6

              Thank you very much SGaist and Eddy i solved the problem; now if dont is to much trouble for you all, you can help me in the next link:

              http://qt-project.org/forums/viewthread/40130/

              I have Qt to Linux and Windows and the both case i have too much troubles about complier and debugger.

              The next problem is about the watch of local variables in debug mode.

              The debugger only show me a changed value, for example:

              i declare a unsigned long long and i expect a value in the watch such:

              00000001-00000002

              but the debugger only show :

              2

              What should i need do?

              Kind Regards,
              Enrique Hernandez
              gearstech.com.mx
              chernandez@gearstech.com.mx

              1 Reply Last reply
              0

              4/6

              23 Mar 2014, 09:06

              • Login

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