LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

trouble with time_t

I am getting

"gate.h"(270,5) syntax error; found 'identifier' expecting '}'.

From this line
time_t iStartTime; //begining of this

How can I fix this?
0 Kudos
Message 1 of 7
(3,851 Views)
This is usually related to having defined elsewhere in your application a panel or control with the same name as the variable od structure field interested (in your case iStartTime). Find the control or panel: renaming it will solve the problem.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(3,851 Views)
Hi,

There is also the option that you need to define something before including the h file. If some of the definitions on the h file are conditional (#ifdef) you may need to define something to get this to compile properly. This is common with the Windows SDK where sometimes you need to define the version of Windows you are compiling for.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 7
(3,851 Views)
well, in the include file of mine where I was using time_t I substituted unsigned int, which took care of it. But I AM also getting the problem in io.h itself.
0 Kudos
Message 4 of 7
(3,851 Views)
It is possible that you can get rid of this errors by changing the order of your include statements. time_t is defined in time.h that will be included by ansi_c.h. Make sure that your include ansi_c.h is at the top of all the includes.

You can also try to include time.h explicitly in your file to make sure that time_tis being declared.

I hope this helps.

Juan Carlos
0 Kudos
Message 5 of 7
(3,851 Views)
I tried adding a line which says that if time_t is not defined, then define it. This gets rid of the problem, but now I get

"Io.h"(110,20) Redeclaration of 'time_t'.

in every module that uses io.h. How can I both have it defined and not defined????

#ifndef _FINDDATA_T_DEFINED
#ifndef time_t //<
typedef long time_t; //<
#endif //<
struct _finddata_t {
unsigned attrib;
time_t time_create; /* -1 for FAT file systems */
time_t time_access; /* -1 for FAT file systems */
time_t time_write;
_fsize_t size;
char name[260];
};
0 Kudos
Message 6 of 7
(3,851 Views)
no ideas?
0 Kudos
Message 7 of 7
(3,851 Views)