cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE(Ver1.17.0)build link error.(GNU toolchain)

k_kato
Associate II

When building with STM32CubeIDE, an error related to gnu-toolchain occurs.

I am attaching the error log.

Looking at the log, it seems that the error occurs because libc.a and libm.a cannot be found.

However, since the above libraries are eventually found in another folder, the error seems to be avoided, but the following error is output afterwards.

collect2.exe: error: ld returned 5 exit status

Even though this error is displayed, the executable file (*.elf) is generated, so the build itself seems to be successful, but I don't know why the error is displayed.

I am not sure what caused this error, but I think it was probably after I upgraded CubeIDE.

I have tried reinstalling CubeIDE and reverting to older versions (Ver1.14.0, Ver1.16.0, etc.), but it did not improve.

If you have any workarounds for this phenomenon, please let me know.

4 REPLIES 4
Mahmoud Ben Romdhane
ST Employee

Hello @k_kato ,

First let me thank you for posting and welcome to the ST Community.

For more investigation, I suggest please that you provide your STM32CubeIDE project.

Thanks.

Mahmoud

k_kato
Associate II

Dear Mahmoud.
Thank you for your reply.

I confirmed this problem by creating a new test project in my environment.

I have attached the entire project file.

This project was created in CubeIDE (Ver1.17.0) by selecting the STM32F072 chip from the new project creation screen.

After creation, no other changes were made to the source code, only a build was performed.

I have also attached the build log from this time, and the error is almost identical to the error log I presented last time.

Does this information tell us anything?

Hello @k_kato ,

 

Further to your comment.

I reproduced your request, the build is finished with 0 errors and 0 warnings using STM32CubeIDE 1.17 with GNU Tools for STM32(12.3.rel1).

MahmoudBenRomdhane_0-1740488256547.png

 

You find in attachment the Log.File.

Thanks.

Mahmoud

 

 

Dear Mahmoud.

Thank you for testing.
I'm sorry that I couldn't reproduce it on your side.

In my environment, the error is occurring as before.

However, I cannot confirm the problem because I do not know the details of the error output by this linker.

I have not changed this project since I created it with the CubeIDE wizard, so I don't think there is a problem with the project itself.
If it does not occur in your environment, it may be an environmental problem with the PC I am using.

It is highly likely that the problem occurred after updating CubeIDE, so there may be some problem when updating from the old version to the new version.
(This problem did not occur when I used it before)

Reinstalling CubeIDE did not improve the situation, so it may be difficult to pursue the root cause of the problem.

Fortunately, I will be able to replace my development environment (PC) with a new model soon, so I would like to test CubeIDE under a clean OS at that time.

It will be a while before I replace my PC, but I will report back when I know the results.

Thank you for your response.