hi there, i have struct with the problem.I'm writing a code for DS12887,And typedef two structures in the header file.It is normal before writing a function. But now the error C141. I am more confused. Ask for The help Header file:
#include <stdio.h> #include <absacc.h> typedef struct { ...... }stTimeStr; typedef struct { ...... }stDsStatus; void InitaliseDS(stTimeStr* stClkTime,stTimeStr* stAlmTime); void SetClkTime(stTimeStr* stClkTime); void SetAlmTime(stTimeStr* stAlmTime); void GetDSStatus(stDsStatus* stStat);
C Source file:
#include <stdio.h> #include <absacc.h> #include "DS12887.h" void InitaliseDS(stTimeStr* stClkTime,stTimeStr* stAlmTime) { ...... } void SetClkTime(stTimeStr* stClkTime) { ...... } void InitaliseDS(stTimeStr* stClkTime,stTimeStr* stAlmTime) { ...... } void GetDSStatus(stDsStatus* stStat) { ...... } void GetDSStatus(stDsStatus* stStat) { ...... }
Sorry - what, exactly, did you change?
Sorry - what, exactly, did you change? as I suggested above byte1 to unsigned char
But (s)he said (s)he'd tried that before, and it didn't work:
13-Feb-2017 01:04 GMT: I'm try change code as this tip....chang "byte_1" to "unsigned char" ... But......But did not work.
13-Feb-2017 12:41 GMT: so,i feel very strange, If i chang code like this,then no error
So my question was what else changed to make it work?
Can you tell me your e-mail,please? i can send source code to u....
My e-mail is zhanghongkun1984@gmail.com
how would my e-mail (which I would not send you anyhow, what is wrong with communicating in the forum) help you communicate with micro (u)?
Private consultancy would be chargeable
What am I missing?
You asked what had changed. The OP offered to send you the code to look at and, presumably, determine for yourself what had changed.
Are you saying you are stating that you would pay the OP for his assistance in telling you the difference???
Will...all right.Can i upload file in this forum? I can upload the source code for download.....
All right....I thought the atmosphere like a Chinese forum...... How can upload file in this Thread?
The forum doesn't have any upload.
But how hard is it to figure out if there exists any type byte_1, and if it is conditionally disabled or not? Or if it's missing just add that as a type yourself?
You are expected to be able to take care of much more complex problems than that.
But how hard is it to figure out if there exists any type byte_1, and if it is conditionally disabled or not?
It could be hard or easy, depending on how complex the header files construct is of which we only get to see the file name: ComUnit.h. The crucial technique to resolve this kind of problem hasn't been mentioned so far: the extraction and inspection of preprocessor output. So: have uVision generate a preprocessor output listing, and look at it very closely.
http://www.keil.com/support/man/docs/c51/c51_preprint.htm
And why are you using #define rather than typedef anyhow?!
And as we all know, it is now illegal/wrong/unacceptable to use a #define rather than a typedef?!
Look at it the other way: the typedef is a part of the language and is specifically designed for this - why would you not use it?!
Look at it another way: Is the use of a #define causing the OP's problem? Or is it just potentially adding confusion to an obvious beginner?