I am a long-time assembler guy in 8051's and PICs, and just got my new Keil C51 IDE package. I am, not fluent in 'C' or Keil tools (yet). I have to look at someone else's existing code and compile it, but I get errors after loading their project and trying a build. Since I am new to the tool set, I am stumped on figuring out what is wrong. Is anyone out there who would take this set of files and help me figure out how ot get it to compile, or what is missing, for a fee? I could send the files and maybe you could help me understand what is wrong or missing? If I was more fluent with the tool set, I could get there myself, but time is critical. Can anyone help? (If this is posed in the wrong place, please forgive me!) Chris
Why not present us the error messages?
I was really hoping to find someone who could "look over my shoulder" and help me get off the ground with this. I can do it if I struggle through, but some help at first would send me on my way faster, that's all.
What's odd to me is that the code includes a "project file", and when I load it I get multiple "main" files. I can't tell how the build figures out which one to use.
Chris
As suggested earlier, that sounds like a Consultant role...
Here's my suggestions on 'C' learning resources:
blog.antronics.co.uk/.../
Make sure you have a header file with the correct prototypes. Include this header in all files that uses the functions - and in the file that contains the implementation.
CheckThresholds() has extra problems because the compiler made an assumption when not having a prototype to rely on. When it finally saw the implementation it detected the error in assumption.
That should solve your current warninngs - but the issue is that you need to understand what you are doing.
That is my vote is that a header file is missing, or not being included. with a possibility of a conditional compile problem.
basically what you are looking for is either: a file that has just the function declaration followed by a semicolon (No Code) just like an extern in ASM. This would be in a file with a .h extension.
The second would be the declarations are in a #if directive, and are not being included.
Note: start at the first error and work down. a single error can confuse the compiler and create 100 error messages for perfectly good code.
Thanks for the input, fellas. After some time, I was given yet another set of files and this time the project compiles OK. Frustrating. What I seem to have is a terribly disorganized and haphazard programmer from whom I have inherited a real mess. (Anyone who thinks that C is "self-documenting" should see this garbage!)
Now I start again and try to understand this, but at least now I have a version that compiles.
Thanks again, and I will look for a consultant for help.
'C' is just a tool - it can be used well, or it can be used badly.
However, understanding any source code does require that you are familiar with the language - its syntax, semantics, and idioms.
I have inherited a real mess.
That sounds like the individual occupying the White House now.
@Dan Henry,
NDAA?
At least the code doesn't lie.
Is this a Yahoo News Forum now?
No, Bad Code is not Obama's fault. Do not like his coding? there is a special day in November just for that.
If you have not inherited Bad Code, you are either lucky or have not work in the business long enough. The worst is watching bad code being written, and hoping you do not inherit it.
Bad Code is not Obama's fault.
Agreed. Bad Code is Bush's fault.
View all questions in Keil forum