View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
problem in compiling ex_fat.c |
Posted: Wed Dec 05, 2012 5:40 am |
|
|
Hi, everyone! I tried to compile ex_fat.c, but the complier returned an error:
"C:\Program Files (x86)\PICC\drivers\fat.c" Line 1867(37,41): Printf format type is invalid ::
It points to this row:
Code: |
sprintf(cur_fnum, "%u", fnum);
|
I`m using mplab v8.88, ccs v4.134.
Can you tell me where is the problem??? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19368
|
|
Posted: Wed Dec 05, 2012 6:02 am |
|
|
Somebody forgot to type an L at CCS.....
Line needs to be:
Code: |
sprintf(cur_fnum, "%lu", fnum);
|
The version with later compilers is OK.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Wed Dec 05, 2012 6:13 am |
|
|
Thanks!
I want to ask one more thing. In ex_fat there is a row:
Code: |
#device PASS_STRINGS = IN_RAM
|
How can I remove this row?? I tried without it but I had an error:
*** Error 90 "ex_fat.c" Line 156(28,29): Attempt to create a pointer to a constant
and it points to if(fatopen(fileName, "a", &stream) != GOODEC)
Best regards! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19368
|
|
Posted: Wed Dec 05, 2012 8:36 am |
|
|
Read the manual, or search here. This has been explained so many times it is obscene.....
It is one way of allowing constant strings to have pointers allocated to them. "a" is a constant string.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|