Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:04:41+00:00 2026-05-31T13:04:41+00:00

I am trying to compile some code for an STM32 chip using CodeBench G++

  • 0

I am trying to compile some code for an STM32 chip using CodeBench G++ Lite tools. However, it generates an error.

    startup.o: In function `LoopFillZerobss':
(.text.Reset_Handler+0x2a): undefined reference to `__libc_init_array'

I have googled and it appears that libc_init_array is probably part of some standard gcc library…but I am not sure how to fix this error?

I also have errors such as this

arm-none-eabi-ld: cannot find libc.a

and similarly for libgcc.a and libm.a

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:04:42+00:00Added an answer on May 31, 2026 at 1:04 pm

    The function __libc_init_array is part of CodeSourcery’s ‘CS3’ mechanism for ‘start up’ code which ensures all of a programs static initialisation happens before main is executed.

    Start by ensuring all of the libraries are found. That might be enough to fix all your problems.

    One approach is to use arm-none-eabi-g++, and not use arm-none-eabi-ld directly, to do the linking because g++ should correctly pass some important parameters to arm-none-eabi-ld. In some case, that might be all that is needed to find and link the correct libraries.

    If you aren’t sure how to build on the command line, or arm-none-eabi-g++ isn’t doing everything to resolve the missing libraries, go and have a look at LeafLabs web site, where they show how build from the command line using Makefiles
    http://leaflabs.com/docs/unix-toolchain.html

    They provide a free, Open Source, IDE for STM32, built for Windows, Linux and Mac, which includes a working gcc-based toolchain for each of those platforms, and enough of the libraries to get started http://leaflabs.com/docs/maple-ide-install.html

    Even if you’d prefer to use your toolchain for the actual build, it may be worth using theirs, with their Makefiles, to sanity check the process you are using to build your program.

    I am not a member of LeafLabs staff, and have no relationship with the company other than I have bought some of their products, and try to answer questions on their forum.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm using Visual C++ 6.0, and trying to compile some source code, but
I'm trying to compile some code that uses the fmemopen function in MinGW. I
I'm trying to compile some code. Here is the error I'm getting: error while
I'm trying to compile some code, but I'm getting an error: Error invalid conversion
I'm trying to compile some assembly code (as part of Theora library) using XCode
I am trying to compile some Clojure code to Java using the Clojure 1.2
I'm trying to compile some code in MonoTouch but I'm getting an error: 'type
i am trying to compile some code to memory at runtime using a CodeDomProvider.
I am trying to compile some code using Octave and I need to link
I have just hit a confusing problem when trying to compile some code using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.