EmbDev.net

Forum: ARM programming with GCC/GNU tools How to link .OBJ file using "arm-elf-gcc" and makefile


Author: Carlos Uchoa (cabu)
Posted on:

Rate this post
0 useful
not useful
Hi,

I am trying compiler an EasyArm examples from kit LCP2214. The
MikroElectronika have given me a directory with many ".OBJ" files to
link with my program. I have used "Sh" shell and "makefile" to compiler
but when I try to compiler using a file from that OBJ directory the "
Make " does not recognize the format. What kind program could I use to
Link that file ? What kind extention is that ? Is it used in linux/unix
?

Could anyone help me please ?!!

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Carlos Uchoa wrote:

> I am trying compiler an EasyArm examples from kit LCP2214. The
> MikroElectronika have given me a directory with many ".OBJ" files to
> link with my program. I have used "Sh" shell and "makefile" to compiler
> but when I try to compiler using a file from that OBJ directory the "
> Make " does not recognize the format.

Give the exact error-message or even better the complete output created
during make which included the arguments to the compiler.

I do not own the EasyARM kit and just took a quick look into the
Examples-package. As far as I can see the examples for the EasyARM-Kit
are created with Realview, so they not compatible with the GNU-tools
(maybe with a GNU toolchain targeted for arm-eabi). Either by Realview
(included in Keil MDK-ARM, eval.-version available) or ask
MikroElectronika for the source-code which have been used to create the
objects, adapt it to the GNU arm-toolchain and compile yourself.

> What kind program could I use to Link that file ?
Realview linker, but this linker will not "understand" arm-elf(oabi)
objects and may not understand arm-eabi.

> What kind extention is that?
Object-Code (basically output of the compiler and input to the linker)

> Is it used in linux/unix?
It's just a file-extension (could be .o) too. Not OS-related.

Author: Carlos Uchoa (cabu)
Posted on:

Rate this post
0 useful
not useful
Thanks Thomas,

 I think You are right. My enviroment is not compatible with the
examples by MikroElectronika. I am using Windows XP and WinARM files to
compile.

 I´ve asked them about the sources code but until now I did not get
reply.

 I am trying to compile a Graphics example. I have the "Glcd.obj" file
to link. When I include it in my "makefile" a get the follow link
errors:

1) Using Glcd.obj directly. Without -l parameter.

< Examples/LPC2214/V100/Examples/GLCD/sh.exe"-2.04$ make

-------- begin --------
arm-elf-gcc (GCC) 4.1.1 (WinARM)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


Linking: Demo.elf
arm-elf-gcc -mcpu=arm7tdmi -I. -g -DROM_RUN  -Os -funsigned-char
-funsigned-bitf
ields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=Demo.o
-std=gnu99 -MD -MP -MF .dep/Demo.elf.d Demo.o Startup.o   --output
Demo.elf -nos
tartfiles -Wl,-Map=Demo.map,--cref -lm  -lc -lnewlib-lpc  Glcd.obj
-TLPC2214_ROM
.ld
Glcd.obj: file not recognized: File format not recognized
collect2: ld returned 1 exit status
C:\WinARM\utils\bin\make.exe: *** [Demo.elf] Error 1
< Examples/LPC2214/V100/Examples/GLCD/sh.exe"-2.04$


2) Now adding the -l parameter in Glcd.obj inside makefile.

Linking: Demo.elf
arm-elf-gcc -mcpu=arm7tdmi -I. -g -DROM_RUN  -Os -funsigned-char
-funsigned-bitf
ields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=Demo.o
-std=gnu99 -MD -MP -MF .dep/Demo.elf.d Demo.o Startup.o   --output
Demo.elf -nos
tartfiles -Wl,-Map=Demo.map,--cref -lm  -lc -lnewlib-lpc  -lGlcd.obj
-TLPC2214_R
OM.ld
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe:
cannot fi
nd -lGlcd.obj
collect2: ld returned 1 exit status
C:\WinARM\utils\bin\make.exe: *** [Demo.elf] Error 1
< Examples/LPC2214/V100/Examples/GLCD/sh.exe"-2.04$

3)And now without the Glcd.obj file ( *** Probably missing library ***)

Linking: Demo.elf
arm-elf-gcc -mcpu=arm7tdmi -I. -g -DROM_RUN  -Os -funsigned-char
-funsigned-bitf
ields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=Demo.o
-std=gnu99 -MD -MP -MF .dep/Demo.elf.d Demo.o Startup.o   --output
Demo.elf -nos
tartfiles -Wl,-Map=Demo.map,--cref -lm  -lc -lnewlib-lpc
-TLPC2214_ROM.ld
Demo.o: In function `main':
C:\Documents and Settings\carlos uchoa\Meus documentos\ARM\EasyARM
Examples\LPC2
214\V100\Examples\GLCD/Demo.c:45: undefined reference to `delay_Nx10cyc'
C:\Documents and Settings\carlos uchoa\Meus documentos\ARM\EasyARM
Examples\LPC2
214\V100\Examples\GLCD/Demo.c:48: undefined reference to `Glcd_Init'
C:\Documents and Settings\carlos uchoa\Meus documentos\ARM\EasyARM
Examples\LPC2
214\V100\Examples\GLCD/Demo.c:61: undefined reference to `Glcd_Fill'
C:\Documents and Settings\carlos uchoa\Meus documentos\ARM\EasyARM
Examples\LPC2
214\V100\Examples\GLCD/Demo.c:63: undefined reference to `Glcd_Image'

************************ etc ....
***************************************

Martin Thomas wrote:
> Carlos Uchoa wrote:
>
>> I am trying compiler an EasyArm examples from kit LCP2214. The
>> MikroElectronika have given me a directory with many ".OBJ" files to
>> link with my program. I have used "Sh" shell and "makefile" to compiler
>> but when I try to compiler using a file from that OBJ directory the "
>> Make " does not recognize the format.
>
> Give the exact error-message or even better the complete output created
> during make which included the arguments to the compiler.
>
> I do not own the EasyARM kit and just took a quick look into the
> Examples-package. As far as I can see the examples for the EasyARM-Kit
> are created with Realview, so they not compatible with the GNU-tools
> (maybe with a GNU toolchain targeted for arm-eabi). Either by Realview
> (included in Keil MDK-ARM, eval.-version available) or ask
> MikroElectronika for the source-code which have been used to create the
> objects, adapt it to the GNU arm-toolchain and compile yourself.
>
>> What kind program could I use to Link that file ?
> Realview linker, but this linker will not "understand" arm-elf(oabi)
> objects and may not understand arm-eabi.
>
>> What kind extention is that?
> Object-Code (basically output of the compiler and input to the linker)
>
>> Is it used in linux/unix?
> It's just a file-extension (could be .o) too. Not OS-related.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.