Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22113

crtatmega328p.o:(.init9+0x0): undefined reference to "main"

$
0
0

I have been trying to compile a robot simulation.

I created an empty file called test.c and tried to compile a test using:

avr-gcc -mmcu=atmega328p test.c

AVR-GCC it's installed

copt@copt:~$ avr-gcc --versionavr-gcc (GCC) 5.4.0Copyright (C) 2015 Free Software Foundation, Inc.Este é um software livre; veja as fontes para as condições de cópia. NÃO HÁgarantias; nem mesmo de COMERCIALIZAÇÃO ou ADEQUAÇÃO A UMA FINALIDADEESPECÍFICA.

and returned this:

/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o:      (.init9+0x0): reference not defined to "main"collect2: erro: ld returned 1 exit status

Very similar to the principal one that I've been trying to make work. I think if solve this very basic problem, the biggest one will be solved.

FLAGS = -mmcu=atmega328p -Wall -gdwarf-2 -O3 -funsigned-char -funsigned-   bitfields -fpack-struct -fshort-enums 

It should be compiling normally.


Viewing all articles
Browse latest Browse all 22113

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>