 fabieng
		
			fabieng
		
		
		
		
		
		
		
		
	
			04-27-2015 04:46 AM
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
04-27-2015 04:59 AM
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,
 Wolfgang
		
			Wolfgang
		
		
		
		
		
		
		
		
	
			
			
    
	
		
		
		04-27-2015
	
		
		05:32 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		11-18-2024
	
		
		12:01 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 Content Cleaner
		
			Content Cleaner
		
		
		
		
		
		
		
		
	
			
		
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.
04-27-2015 06:50 AM
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
 gdargaud
		
			gdargaud
		
		
		
		
		
		
		
		
	
			04-30-2015 05:32 AM
What is the reason for 'index' now being a reserved keyword ? What is it used for ?
04-30-2015 07:41 PM
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.