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. Using compiler switches with Qt Qmake
Forum Updated to NodeBB v4.3 + New Features

Using compiler switches with Qt Qmake

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.7k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    subin
    wrote on 27 Nov 2011, 04:44 last edited by
    #1

    Hi All,

    I've developed a simple currency converter application in Qt. For conversion multipliers I've declared a two dimensional float array in my header and I had a statement like one below in my cpp file,
    @currency[3][3] = {{2,2,2},{2,2,2},{2,2,2}};@
    But, when I build it, I get the following warning/error.
    @../mainwindow.cpp:15: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x
    ../mainwindow.cpp:15: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘float’ in assignment@
    As I see the debug info, I figured out that I can set the -std switch for gcc, to override this issue. But, I don't think, I could make changes in the makefile created each time I build with qmake. Is there any solution for this?

    Thank You

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 27 Nov 2011, 11:30 last edited by
      #2

      Are you using qmake directly or through an IDE?
      If you are using qt creator you may change the settings under projects.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 27 Nov 2011, 14:38 last edited by
        #3

        Add to your .pro file:

        @
        QMAKE_CXXFLAGS += -std=c++0x
        QMAKE_CFLAGS += -std=c++0x
        @

        Maybe you need to set the xxx_DEBUG flags too. See the qmake manual/variable description for details.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • S Offline
          S Offline
          subin
          wrote on 27 Nov 2011, 19:27 last edited by
          #4

          Volker, Koahnig,

          It worked.

          Thank You

          1 Reply Last reply
          0

          4/4

          27 Nov 2011, 19:27

          • Login

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