11-25-2016 03:03 AM
Hello,
I have just installed CVI 2015 SP1 and I am trying to compile a CVI 8.5.1 project but I get a lot of "error: expected ')'" errors. For instance here:
BOOL LEM_502A_Init () { if (!Init ()) { return FALSE; } // Initialization of main frame. if (!LEM_502A_Display_Init (FINAL_FRAME_PANEL)) { return FALSE; } // Initialization of Golden Device frame. if (!LEM_502A_Display_Init (GOLDEN_DEVICE_PANEL)) { return FALSE; } // Initialization of maintenance frame. if (!LEM_502A_Display_Init (MAINTENANCE_PANEL)) { return FALSE; } Application_SetMode (AUTOMATIC_MODE); return TRUE; }
I get this error on each return FALSE; line. I tried adding brackets as in return (FALSE); but it makes no difference. Any idea?
Thanks.
11-25-2016 04:33 AM
#define FALSE 0
11-25-2016 04:58 AM
Thanks, obvious actually, I understood just after I posted. Still it is defined in a .h file and it worked before, I cannot figure out what I have broken...
11-25-2016 05:49 AM
TRUE and FALSE are defined in several files in CVI environment: e.g. the Programmer's Toolbox (toolbox.h) or minwindef.g which is included after including windows.h
The actual file this element is included into in the original project, if CVI 8.5.1 is still available, can be found by pressing Ctrl+I on the keyword (or Right-click + Go to definition)
11-25-2016 05:57 AM - edited 11-25-2016 06:00 AM
I have already tried Ctrl + I, it does not find corresponding the header file. I have just tried reopenenig the workspace and compiled it with 8.5.1 -> it works... I shoud probably check the build settings, but I do not know where to start.
11-25-2016 07:07 AM
If it can be compiled and linked, then in CVI8.5 Ctrl+I must find the definition of TRUE and FALSE
11-25-2016 07:46 AM - edited 11-25-2016 07:46 AM
Well it is weird, when I do Ctrl + I in 8.5.1 it leeds me to a line in an other .c file that has this include instruction: #include <utility.h> I have never seen this behaviour before. I checked in utility.h and it does not define TRUE or FALSE.
On the other hand I have found 2 .h files in my project that define TRUE/FALSE. I really do not see what is wrong or why it worked in 8.5.1.
Thanks for your answers.
11-25-2016 10:20 AM
When I'm in such troubles that I cannot understand what's happening in compilation I try deleting the cvibuild.something folder and the .cdb and .exe files created in debug compile, then recompile the project and retry: maybe this can fox your problems and lead you to actual TRUE/FALSE definition.
11-25-2016 12:11 PM
I had already tried deleting the .cvibuild folder, with no positive result. I tried the other files you told me but it is still the same. I have opened a support request with NI, I will post here when I have a solution.
Thanks for your time, have a nice week-end.