LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8 has problems with the code of CVI 2009 - why?

Solved!
Go to solution

I've been using NI CVI 2009 and thus programmed. Now I have purchased CVI 8 and wants to continue programming. But CVI reports errors in the source code of CVI 9 and I do not understand what the problem is?

 

example

 

char save[size+1];

 

 

erros

128, 22   Integer expression must be constant.
...

 

What is wrong with this simple line of code which previously worked perfectly?

Message Edited by susay on 03-03-2010 09:07 AM
0 Kudos
Message 1 of 3
(3,316 Views)
Solution
Accepted by topic author susay

Unfortunately variable-lenght array declarations is a c99 feature which is supported in CVI9 but probably not in release 8. If you are running CVI8.5, you may try adding this pragma to the code and see if this solves the problem, but according to this list of features posted by Luis I'm not positive in this respect:

 

#pragma iso_9899_1999;
 

Message Edited by Roberto Bozzolo on 03-03-2010 09:36 AM


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 3
(3,301 Views)

In fact, I have only version 8.0
Ok So now I have to follow the standard ANSI C 89. Good to know.
I have solved the above-mentioned problem by malloc.

 

I hope I have with CVI 8 not further unpleasant surprises.

0 Kudos
Message 3 of 3
(3,292 Views)