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. Compiler flags
Qt 6.11 is out! See what's new in the release blog

Compiler flags

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 17.6k 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
    soroush
    wrote on last edited by
    #1

    Hi

    I need to write a parser for a regular language. The parser is part of a C++ program, so it's source code goes inside a Qt project (hopefully). The language that should be parsed is a regular one, so I'm going to use flex++ to generate fastest possible parser class.

    The problem is that I get errors during compilation. I think it's because of flags. The parser class should compiled and linked with -lfl flag. How do I change my .pro file or project setting for this?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludek.vodicka
      wrote on last edited by
      #2

      you can use QMAKE_CXXFLAGS for compiler flags and QMAKE_LFLAGS for linker flags in your .pro file.

      for eaxmple:

      @QMAKE_CXXFLAGS+=-Wno-ignored-qualifiers@

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        Add this to your .pro file:

        @
        LIBS += -lfl
        @

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • S Offline
          S Offline
          soroush
          wrote on last edited by
          #4

          I tried both. but linker says 'undefined reference to yyFlexLexer::yywrap()' again.

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

            Did you have a look at qmake's "LEXSOURCES":http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#lexsources variable?

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

            1 Reply Last reply
            0
            • S Offline
              S Offline
              soroush
              wrote on last edited by
              #6

              bq. Did you have a look at qmake’s LEXSOURCES [doc.qt.nokia.com] variable?

              No I didn't even know they exist. I read them right now and don't understand how to use them. Could you explain what exactly should I do to obtain lexer class?

              I currently put LEXSOURCES = rules.l in project file. so how should I do now?

              (Googled around a lot but there is no clear description ! )

              1 Reply Last reply
              0
              • S Offline
                S Offline
                soroush
                wrote on last edited by
                #7

                Ok that was mistake to put rules file, I should set LEXSOURCES to lex source files. now set LEXSOURCES = lex.yy.cc and have 995 errors.

                I'm really confused

                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