Compiler Error in CodeWarrior
Hi All:
I have a project written on the Mac in CodeWarrior (it is a plugin for InDesign, which requires CW on the Mac) that provides me with the following error several times:
Error: Declaration syntax error
time.h line 48 time_t tv_sec;
The header file has the following two statements at the top:
#include <time.h>
#include <sys/types.h>
I recognize that time_t is a type of array, probably defined in sys/types.h. I have checked access paths and found them to be correct. Why can't the compiler find sys/types.h?
I would appreciate any help you can give me.
TIA!
John
[668 byte] By [
pedantic] at [2007-11-19 7:29:39]

# 1 Re: Compiler Error in CodeWarrior
If time_t is defined in <sys/types.h>, then you have to include it first.
#include <sys/types.h>
#include <time.h>
# 2 Re: Compiler Error in CodeWarrior
Unfortunately, this is a system header. Should I have to change a system header, and is it safe so to do?
# 4 Re: Compiler Error in CodeWarrior
Unfortunately, this is a system header. Should I have to change a system header, and is it safe so to do?
The error is most unlikely to be in a third-party header!
I would recommend against changing them!!
For instance, when one works with STL, an incorrect predicate usage may take one to the <list> header --> of course, the fault is not with the list!! :D
Besides that, will you go about fixing third-party headers on every PC you want your program to be built on?
Please review your code, inclusions and your usage of time_t objects. :)
Perhaps, posting your code here will help! :wave: