I compiled den.C file with den1.C
den1.C is clearly included in the den.C.
But I got an error such as "undefined identifier b".
when I put int b=1; in the main . It is OK.
But for this time,
I got "Can not change device type this far into the code"
What should I do?
I use 3.155 ver., MPLAB IDE ver is 6.3.
What is the reason you think?
thanks for help
// The following is the first file (den.C)
#include<16f877.h>
#include"den1.c"
main(){
int a;
a=a+b;
return 0;
}
*******
// This one is included file (den1.C)
#include<16f877.h>
int b=1;
fonk(){
return b;
}
John Morley
Joined: 09 Aug 2004 Posts: 97
Posted: Tue Nov 16, 2004 12:51 pm
Hi,
If you read the error message carefully, I think your problem becomes quite obvious! Apparently the compiler does not like the fact that you have an #include<16f877.h> statement in each module. At least that is how I would interpret the "Cannot change device type this far into the code" error......
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum