Linker Problem

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jan 9 06:02:56 UTC 2020


Hello Reuben,

On 08/01/2020 22:48, Fresquez, Reuben Anthony wrote:
> Hello,
> 
> I am currently using Geisler’s RCC 1.2 and RTEMS 4.10. I am getting an 
> error after compiling my c files into object files, and then linking 
> them together. The error I get is:
> 
> /opt/rtems-4.10/sparc-rtems/leon3/lib/librtemscpu.a(dummy.o):(.data+0x2c): 
> undefined reference to `main'
> 
> collect2: ld returned 1 exit status

a likely reason for this error is that you don't have an application 
configuration or the configuration is somehow incomplete or inconsistent:

https://docs.rtems.org/branches/master/c-user/configuring_a_system.html

You can look at the linker map file (GCC link option "-Wl,-Map,map.txt") 
to figure out what pulled in dummy.o.

> 
> I am using “sparc-rtems-gcc“ to do the linking, and cannot seem to 
> figure out how to get around this problem. The file “librtemscpu.a” is 
> part of the prebuilt libraries included in the RCC 1.2 distribution, and 
> I cannot find any source code for this file to inspect the unresolved 
> reference to main. I am wondering if any of you have suggestions about 
> solving this issue or maybe have run into the same thing. Please let me 
> know.

I guess you can obtain the sources in an extra package. Working without 
the RTEMS sources could turn out to be difficult in the long run.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the users mailing list