LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

implicitly declaring C library function

Hello,

 

I am currently working on a project where a program has been entirely written for Lab WIndowsCVI 2010 and the program worked.

 

Now we have done an upgrade of Labwindows CVI 2010 to Labwindows CVI 2013 and the program that before worked now give me these errors:

 

 main.c - 5 errors
  108, 13    error: implicitly declaring C library function 'index' with type 'char *(const char *, int)'
  108, 29    error: non-object type 'char *(const char *, int)' is not assignable
  109, 54    error: cannot increment value of type 'char *(const char *, int)'
  300, 27    error: non-object type 'char *(const char *, int)' is not assignable
  1162, 14   error: non-object type 'char *(const char *, int)' is not assignable
Build failed.

 

It looks I have a variable called index and this variable is maybe declared as a table like that : ssize_t index[]

in a file h.

 

My questions are:

 

-> How can I know where my variable is declared? Is there a shortcut for that? The program is very long there are many files .c and .h.

-> Is there an option in LabWindows CVI 2013 to make a compatible conversion of the written program from Labwindows CVI 2010 to Labwindows CVI 2013 ?

 

Thanks for your help,

regards,

Fabien

 

 

 

0 Kudos
Message 1 of 6
(5,876 Views)

Hello,

 

I just precise that when I double click on the variable in my main.c, I then press CTRL+I and I see that my variable index is in many different files .h and .c but each time it's a parameter, I cannot see where it is defined.

 

Thanks,

 

0 Kudos
Message 2 of 6
(5,874 Views)

There are some changes and even incompatibilities of CVI2013 with earlier versions due to the use of a different (better) compiler. You can find them here.

One is that you cannot name a global integer variable index. Using index as a global variable will result in a compiler error: redefinition of 'index' as different kind of symbol. You must rename index to work around this.

0 Kudos
Message 3 of 6
(5,866 Views)

Hello,

 

Thanks for your reply and for inform me about the difference between CVI 2010 and CVI 2013,

 

I couldn't find where my variable index was declared. So I tried to declare "index" as static int in the main.c and now it works.

I guess it may causes some problems since that maybe index is declared inside a librairy or any other file called by a librairy. And if that file is missing on my compute, it may causes some problem but the truth is that I have no compiler error.

 

Regards,

Fabien

 

 

 

0 Kudos
Message 4 of 6
(5,857 Views)

What is the reason for 'index' now being a reserved keyword ? What is it used for ?

0 Kudos
Message 5 of 6
(5,819 Views)

Hi, gdargaud

 

index is a function defined in the gnu c standard library. According to the linked document, index is only around for compatibility, and it does the same thing as strchr.

Daniel Dorroh
National Instruments
0 Kudos
Message 6 of 6
(5,799 Views)