This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++ compilation error on gcc 4.4.6
- From: "GUPTA, GAURAV G (GAURAV)" <gaurav dot g dot gupta at alcatel-lucent dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 18 Mar 2013 18:32:59 +0530
- Subject: g++ compilation error on gcc 4.4.6
Hello There
While trying to compile my c++ application with new gcc/g++ I am hitting the below error .
Where as I see the timeval is defined in time.h and I have included time.h
/vob/ngn_src/include/CpsCmnTime.h:457: error: invalid use of incomplete type 'const struct timeval'
/vob/ngn_src/include/CpsCmnTime.h:160: error: forward declaration of 'const struct timeval'
My declaration is as below .
inline static bool setTime (struct timespec& pTimespec, struct timeval???????? const &pTimeVal);
inline? bool CpsCmnTime::setTime (struct timespec& pTimespec,
???????????????????? struct timeval const &pTimeVal)
{
? pTimespec.tv_sec = pTimeVal.tv_sec + (pTimeVal.tv_usec / 10000000);
?? (pTimeVal.tv_usec % 1000000)
???? ? pTimespec.tv_nsec = (pTimeVal.tv_usec % 1000000) * 1000
?? : pTimespec.tv_nsec = 0;
? return true;
}
Thanks
Gaurav