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. QLALR - QParser example crashes at startup on Visual Studio 2008

QLALR - QParser example crashes at startup on Visual Studio 2008

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.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.
  • I Offline
    I Offline
    inopportuno
    wrote on last edited by
    #1

    Unfortunately I have to parse a language (JScript). I started to study how to use Flex knowing that Qt is providing a useful tool called QLALR in order to generate parser.
    In \util\qlalr\examples\qparser I found a very interesting example integrating a flex generated scanner and qlalr generated parser. Also, from what I understood (but it couldn't be true...) the example introduces a useful QParser interface to avoid to rewrite parse function. In order to compile it I had to download a unistd.h for windows from http://sourceforge.net/projects/gnuwin32/files/flex/2.5.4a-1/flex-2.5.4a-1-lib.zip/download. It is in the directory include. In any case is nothing more than:

    @/*

    This file is part of the Mingw32 package.
    *
    unistd.h maps (roughly) to io.h
    */
    #ifndef STRICT_ANSI

    #include <io.h>
    #include <process.h>

    #endif@

    Using this file I was able to compile the qparser example but when I run it I get a crash before entering in main function with error message: The program '[3736] qparser.exe: Native' has exited with code 2 (0x2).

    I'm getting also the following warning messages:

    @1>lex.calc.c(903) : warning C4003: not enough actual parameters for macro 'calcwrap'
    1>lex.calc.c(1056) : warning C4018: '<' : signed/unsigned mismatch
    1>lex.calc.c(1238) : warning C4003: not enough actual parameters for macro 'calcwrap'
    1>lex.calc.c(1402) : warning C4996: 'isatty': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _isatty. See online help for details.
    1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h(312) : see declaration of 'isatty'
    1>lex.calc.c(1402) : warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _fileno. See online help for details.
    1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(722) : see declaration of 'fileno'
    1>Linking...
    1>LINK : debug
    qparser.exe not found or not built by the last incremental link; performing full link@

    I'm using Visual Studio 2008 on Windows 7 and Qt 4.8.0 compiled from the same package where I got QLALR.

    Some suggestions?
    Thanks

    Guido Ranzuglia

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

      You should not mix headers (unistd.h) from MinGW with Visual Studio. I don't know where the get a decent version for MSVS, unfortunately.

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

      1 Reply Last reply
      0
      • I Offline
        I Offline
        inopportuno
        wrote on last edited by
        #3

        Thanks for the suggestion!

        1 Reply Last reply
        0
        • I Offline
          I Offline
          inopportuno
          wrote on last edited by
          #4

          Ok I resolved the thing by myself.
          The problem is that the provided .pro has not included the win32-msvc2008:CONFIG += console directive.
          I suggest you, also, to add an %option nounistd at the beginning of the calc.l and an #include<io.h> in order to use the atty function provided in the default include directory.

          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