I am compiling a project using uvision4 and it compiling right, but when its start linking it gives me an error
Build target 'Target 1' assembling Startup.s... compiling hello.c... C:\Keil\ARM\INC\Luminary\lm3s6918.h(2808): warning: #47-D: incompatible redefinition of macro "SYSCTL_RCC_XTAL_M" (declared at line 487 of "C:\Keil\ARM\INC\Luminary\hw_sysctl.h") linking... hello.axf: Error: L6218E: Undefined symbol FlashUserGet (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol Formike240x320x16_ILI9320BacklightOn (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol Formike240x320x16_ILI9320Init (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrCircleDraw (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrContextInit (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrRectDraw (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrRectFill (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrStringDraw (referred from hello.o). hello.axf: Error: L6218E: Undefined symbol GrStringWidthGet (referred from hello.o).
I have included the libraries it compiles but it doesn't finde the object files....
Need help...
The way to create *.o or *.obj files from *.h and *.c or *.cpp files is called compilation.
Yes, Keil does include a compiler.
No, you do not need to specifically add the object files to the project - the tools already knows that the compiler should take *.c or *.cpp files anc reate object files, and that these object files should be sent to the linker.
It's only when someone gives you either binary library file or object file and a couple of header files, that you need to add these library or object files.
Your own object files from your own compilation does not contain the implementation of the functions from a third-party library. So adding your own object files to the project will not help. You need to add the library file itself to the project.
The object files created from your source files contains references "want to call function x".
The object files hidden within the library (a library is basically a container with one or more object files - i.e. the output from compilation *.c or *.cpp files). But these objects contains "the description of what to do when someone calls function x".
This doesn't have anything to do with embedded programming. It's the same thing when developing on a PC. Any decent book on C programming should explain the build process - conversion of C/C++ files into object files. And linking of object files + optional library files into executables.
Thanks for the help... It's working now.