02-10-2012 06:21 PM
Hello,
I developed a GUI in LabWindows 9.0 which used the time_t type and other time functions etc. Everything worked fine on my office computer but I needed to import this GUI to another computer that is running LabWINDOWS 7.1.
When I try to run the GUI in 7.1, I get the error "illegal use of type 'time_t'". I've erased the declaration and re-typed it, etc. ensured time.h was included etc. but no go. I'm out of ideas?
I also seem to run into a similar issue with FILE. Again, everything worked perfectly on my PC w/9.0 but not on the 7.1 machine.
I tried starting a new file in 7.1 using time_t but still got the issue. Is this not supported in 7.1? If so, how do I go about getting time readings for timestamps?
Thanks!
JT
02-11-2012 12:16 PM
Hi,
newer GUI versions may provide new functionality and hence it is not guaranteed that a GUI will load or work in an earlier version of CVI. You can try and save the GUI in CVI 9.0 using the 'Save As' dialog, which provides the option to save in earlier versions, including 7.1
.
02-13-2012 03:10 AM
02-13-2012 11:35 AM
Thanks for the replies!
I did go back and "Save as" 7.1 after I opened the 9.0 file in 7.1 and got several error messages. I don't remember the exact error message but it was along the lines of something being created in a later version and can't be used here. Would I like to continue anyway....
After wiping out the original install of my program (not LabWINDOWS), I installed the new "saved as 7.1" version. The program loaded without incident but at run time, I got the errors about the illegal use of time_t.
Here is the list of header files that are in my .c file:
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
#include "User Interface Application.h"
#include <stdio.h>
#include <time.h>
I thought the .uir (or some other file) may have been corrupted while loading my program on to the PC so I made a simple test CVI file consisting of just the time functions. Same "illegal use" issue came up.
I'm wondering if recbuilding the program from scratch might reset some stuff??? That would be tedious but perhaps necessary.
I'm also wondering if the install of CVI 7.1 and/or some libraries didn't get installed correctly? If this is the case, then obviously rebuilding the program wouldn't help.
Thanks again for the comments. I appreciate any and all help!!
02-13-2012 02:12 PM
Figured it out!
In my original v9.0 code, I was declaring the 'time' and FILE variables inside a case statement of a switch.
I moved the declarations outside the case statement and now everything works fine!
I'm a newbie to CVI (I usually work in LabVIEW) so I guess this is a newbie mistake!
Thank you for all the suggestions!
JT
02-14-2012 07:10 AM