Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3497

Build fails with "invalid use of incomplete type"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • C++ - Library
    • gcc 4.8.5 on Haiku hrev49934 (x86)

    Description

      Building the latest code in git on Haiku fails with a number of error messages like

      In file included from src/thrift/concurrency/Monitor.cpp:22:0:
      ./src/thrift/concurrency/Util.h: In static member function 'static void apache::thrift::concurrency::Util::toTimeval(apache::thrift::concurrency::timeval&, int64_t)':
      ./src/thrift/concurrency/Util.h:73:11: error: invalid use of incomplete type 'struct apache::thrift::concurrency::timeval'
           result.tv_sec = static_cast<uint32_t>(value / MS_PER_S);                // ms to s
                 ^
      In file included from src/thrift/concurrency/Monitor.cpp:20:0:
      ./src/thrift/concurrency/Monitor.h:88:32: error: forward declaration of 'struct apache::thrift::concurrency::timeval'
         int waitForTime(const struct timeval* abstime) const;
      ...
      

      This seems to be caused by Monitor.h using struct timeval but not explicitly including sys/time.h. Changing Monitor.h so it conditionally includes sys/time.h on systems that have it resolves the issue.

      Attachments

        Activity

          People

            simonsouth Simon South
            simonsouth Simon South
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: