This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Uvision Linker ERROR

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...

Parents
  • I have have included included all *.o files that i make and then i add them but it gives me another error.

    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: L6242E: Cannot link object adc.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object can.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object comp.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object cpu.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object epi.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object ethernet.o as its attributes are incompatible with the image attributes.

    On the libraries there is a makefile, the generate the *.o files, i did de command make. i insert them on the project but i didn't work.

Reply
  • I have have included included all *.o files that i make and then i add them but it gives me another error.

    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: L6242E: Cannot link object adc.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object can.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object comp.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object cpu.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object epi.o as its attributes are incompatible with the image attributes.
    hello.axf: Error: L6242E: Cannot link object ethernet.o as its attributes are incompatible with the image attributes.

    On the libraries there is a makefile, the generate the *.o files, i did de command make. i insert them on the project but i didn't work.

Children
  • I want to know if there is any way to generate the *.o files from the *.h and *.c in keil uvision4.

  • 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.