| |||||
Technical Support Support Resources
Product Information | µVISION1: INCLUDING OBJECT FILES IN LINKInformation in this article applies to:
QUESTIONMy project consists of two source files, SOURCE1.C and SOURCE2.C. When these are compiled, I link them with some object files that were built in another project, EXTERN1.OBJ through EXTERN3.OBJ. The way I currently build my project is to run a batch file, which compiles the source files, and call the linker using the following linker command file: EXTERN1.OBJ, & EXTERN2.OBJ, & EXTERN3.OBJ, & SOURCE1.OBJ, & SOURCE2.OBJ, & TO OUTPUT RAMSIZE(0FFh) PDATA(0400h) XDATA(0400h) I tried to create a µVision project which included the two source files and called the linker command file, however, I get an error when it tries to link. How do I convert my batch file based project to a µVision project? ANSWERWhen using µVision, the linker command file may only contain directives, not lists of object files or an output file, so the first thing to do is change your linker command file to: RAMSIZE(0FFh) PDATA(0400h) XDATA(0400h) Next, you need to add the object files to your project in such a way that they are only linked, not compiled or assembled (translated). Complete the following steps for each object file:
You will now be able to build your project successfully. Note that you should not add object files in this way if they are generated from a source file that is already included in the project. The result is that the object file will be linked twice, generating errors. MORE INFORMATIONSee also: µVision1: LINKER COMMAND AND RESPONSE FILES Last Reviewed: Tuesday, June 15, 2004 | ||||
| |||||