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
QtWS25 Last Chance

Compiler flags

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 16.7k 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.
  • S Offline
    S Offline
    soroush
    wrote on 4 Jul 2011, 09:21 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 4 Jul 2011, 09:41 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 4 Jul 2011, 09:53 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 4 Jul 2011, 10:35 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 4 Jul 2011, 13:21 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 4 Jul 2011, 13:44 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 4 Jul 2011, 14:02 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

                2/7

                4 Jul 2011, 09:41

                topic:navigator.unread, 5
                • Login

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