[
https://issues.apache.org/jira/browse/THRIFT-3497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aki Sukegawa resolved THRIFT-3497.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.0
> Build fails with "invalid use of incomplete type"
> -------------------------------------------------
>
> Key: THRIFT-3497
> URL: https://issues.apache.org/jira/browse/THRIFT-3497
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.9.4
> Environment: gcc 4.8.5 on Haiku hrev49934 (x86)
> Reporter: Simon South
> Assignee: Simon South
> Priority: Minor
> Labels: c++, haiku, library
> Fix For: 1.0
>
>
> Building the latest code in git on [Haiku|http://haiku-os.org/] fails with a
> number of error messages like
> {noformat}
> 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;
> ...
> {noformat}
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)