When I put #include <ctype.h> at the top of my source file, the compiler finds it. If I add #include <reg688.h>, I get error "can't open file 'reg688.h'". If change it to read #include <philips\reg688.h>, it still can't find the file. And if I put the full path in ( <c:\keil\c51\inc\philips\reg688.h> ) it STILL CAN'T FIND the file. What is this stupid compiler looking for?
probably looking for a programmer that understands 'C'?
Hint: what does a backslash do in a 'C' string...?
Well, genius, the backslash works fine for other includes. No, I think the issue is being dyslexic. Using reg668.h works better than reg688.h.
But this still doesn't solve my original problem of why, when I include reg668.h, I get ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL errors, as if the file was being included twice, and if I leave it out, I get UNDEFINED SYMBOL errors. The errors are in an asm file that is part of the project. But the symbols it's complaining about are defined in the reg668.h file. And it's not all the symbols, only some are supposedly undefined. And it doesn't matter if I include the reg668.h file in the main C file or in the asm file. I get the same errors.
Have you written your own header files in your project that includes reg668.h? I once had a similar problem because i made a mistake of including the std headers in my own header file.
You can also try putting #ifndef/#define/#endif statement in the reg668.h
No, I didn't write my own reg668.h file. I'm using the one supplied by Keil. What I did to get this to compile was to put the #include <reg668.h> in the main C file, then copy and paste those particular defines in reg668.h that my asm file is looking for into the asm file. Notice that I did a copy and paste. Meaning that those defines are now declared twice in the project, yet no compiler error. There is some interaction between the C file and the asm file that I'm not understanding. I should not have to do this, but so far it's only way I can get it to compile.
Note that the assembler code (the startup file) will not know anything about any declarations you use in the C code. And one C file will not know anything about any declarations you have in another C file or in the assembler startup file.
careful Per, before you know it you will be declared as a "genius" as well...
Ah, but if a genius is defined as slightly better than a stupid compiler, that may not take - or mean - much :)
View all questions in Keil forum