Resolution INIT.C: (. text+0x34): Undefined reference to ' main '

Source: Internet
Author: User

When compiling the program encountered the following problems, encountered several times, also do not know how to solve the problem. Today, I met again, or looked for a long time. In order not to let himself be recorded here, memory is really not.

Recommend a blog here, write or good http://www.cnblogs.com/wanyao/archive/2011/06/27/2091666.html.

Arm-linux-gcc-wall-o2 Led.c-o Main.cgi/opt/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root/usr/lib/crt1.o:in function ' _start ':
INIT.C: (. text+0x34): Undefined reference to ' main '
Collect2:ld returned 1 exit status
Makefile:11:recipe for Target ' main.cgi ' failed

Make: * * * [main.cgi] Error 1

The above error, in fact, their own makefile error, in the generation of the main file, you have to write the main () function at the beginning of the dependency. For example, there are three files main.c

ADC.C fun.c of three files. If your order is ADC.C fun.c main.c, the above error will appear after make, and the correct order is main.c start.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.