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. Add -fpermissive at the compiler
Forum Updated to NodeBB v4.3 + New Features

Add -fpermissive at the compiler

Scheduled Pinned Locked Moved General and Desktop
10 Posts 6 Posters 23.4k 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.
  • L Offline
    L Offline
    luca72
    wrote on last edited by
    #1

    Hello i have this error:
    error: cannot call constructor ‘QHostAddress::QHostAddress’ directly [-fpermissive]
    How i can solve?

    Thanks Luca

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Would you enlighten us with some code, please? :-)

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

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca72
        wrote on last edited by
        #3

        @
        QString ip:
        QHostAddress ip_test;
        ip_test = QHostAddress::QHostAddress(ip.toLongLong());@
        error: cannot call constructor ‘QHostAddress::QHostAddress’ directly [-fpermissive]

        Thanks Luca

        1 Reply Last reply
        0
        • L Offline
          L Offline
          luca72
          wrote on last edited by
          #4

          No solution please?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            danimo
            wrote on last edited by
            #5

            This is not a compiler bug/problem, but, sorry to say that, a lack of C++ skills and I can see why nobody is responding. Please look at http://www.cplusplus.com/doc/tutorial/classes/ to see how constructor declaration, implementation and usage differ in Syntax.

            Given a QString ip, what's wrong about

            @
            QHostAddress ip_test(ip)?
            @

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              [quote author="luca72" date="1323253935"]No solution please?[/quote]

              Nagging after 3 hours? You're not serious! Please read and understand: http://www.catb.org/~esr/faqs/smart-questions.html

              If considered ok at all then pushing a topic is acceptable after waiting a few days, not after 3 hours.

              Danimo already gave you the answer, what's wrong with your syntax.

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

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                ydk2
                wrote on last edited by
                #7

                I know is you ask long time ago, but try add to project *.pro file:
                QMAKE_CFLAGS += -std=c++11 -fpermissive
                QMAKE_CXXFLAGS += -std=c++11 -fpermissive
                QMAKE_LFLAGS += -std=c++11 -fpermissive
                I use it for Mac and GCC4.8.1

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andsun
                  wrote on last edited by
                  #8

                  ydk2, are you sure it is as you write

                  QMAKE_CFLAGS = -std=c+11 -fpermissive
                  QMAKE_CXXFLAGS = -std=c+11 -fpermissive
                  QMAKE_LFLAGS = -std=c+11 -fpermissive

                  Because I get a complaint from the compiler "unrecognized command line option '-std=c+11'"

                  1 Reply Last reply
                  0
                  • Y Offline
                    Y Offline
                    ydk2
                    wrote on last edited by
                    #9

                    Sorry I use gcc-4.8.1 on Mac with C11 support, but simple erase -std=c+11 and leave only
                    QMAKE_CFLAGS = -fpermissive
                    QMAKE_CXXFLAGS = -fpermissive
                    QMAKE_LFLAGS = -fpermissive

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Austin25
                      Banned
                      wrote on last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0

                      • Login

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