LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

time_t issue again

I am still having issues with time_t in one particular place. In the below definition from io.h I am getting

"Io.h"(110,6) syntax error; found 'identifier' expecting '}'

on the third line of the below structure.


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];
};

I am uploading my copy of io.h so you can see if I modified something incorrectly.
0 Kudos
Message 1 of 8
(3,847 Views)
Hi Rich,

Try putting #endif before the line

#if _INTEGRAL_MAX_BITS >= 64

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 8
(3,847 Views)
which one? I count four occurances.
0 Kudos
Message 3 of 8
(3,847 Views)
Hi,

It's the first occurrance, using a search tool.

regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 8
(3,847 Views)
Hi,

Forget all I said before.
The problem appears to be that wchar_t doesn't get defined.

At line 88 _WCHAR_T_DEFINED is now defined and therefore wchar_t doesn't get declared.

Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 5 of 8
(3,847 Views)
Thanks. I'm still not there. I commented out the line that defined WCHAR_T_DEFINED that I had added at some time in the past.

*
* [Public]
*
****/
//#define _WCHAR_T_DEFINED //richb
//#define _TIME_T_DEFINED //richb
#if _MSC_VER > 1000
#pragma once
#endif

Now I get

"Io.h"(89,31) Redeclaration of 'wchar_t'.
0 Kudos
Message 6 of 8
(3,847 Views)
Hi,

You must have previously declared wchar_t, before io.h, which is different from the one that's in io.h.

All I have in a simple CVI project, a c file with a WinMain and your io.h file. the project builds without any errors with the two richb lines commented out.


Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 7 of 8
(3,847 Views)
Hi,

I tried running the same example as Ray did, using io.h and a simple c file with WinMAin. My project builds without errors as well. I would definitely check out any previous declarations you might have made for wchar_t. In addition, I would try making a new project and recreating the test Ray and I did to see if the error persists in your code. If it works ok, then I would go back and recreate your project piece by piece to find that redeclaration.

Hope this helps!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 8 of 8
(3,847 Views)