I have written a program with several include files. The main program has some assembly code and for that I have used src directive. I assembled the main program which created the .src extension and then replaced the original C file with the .src. file. I also included the library file C51C.lib in the project and then build the project. The Project is successfully compiling but the hex file is too small compared to similar programs that I have written before. This is the how I included the other .C files in my program.
#pragma src #include <stdio.h> #include <intrins.h> #include <string.h> #include <ctype.h> #include <process.h> #include "keyboard.h" #include "34init.c" #include "map.c" #include "master.c" #include "voltage.c" #include "receive.c" #include "transmit.c" #include "alarm.c"
I'd have thought it was pretty obvious that adding a closing comment at the end of your source code to rectify an 'unterminated comment' error wasn't a very good idea. Another thing that isn't a very good idea is using #include with .c files. You should create a project and add the files to the project instead. Stefan