cancel
Showing results for 
Search instead for 
Did you mean: 

microros librart not include properly

USER_RG
Associate II

Hi everyone,
I'll start by saying I'm just starting to use STM32cubeIDE. I'm having trouble configuring the microros configuration  in my project involving an STM32F767zi board.
Specifically, I managed to include everything I needed, and now when I compile, the result is as follows:

 

make -j8 all

docker pull microros/micro_ros_static_library_builder:jazzy && docker run --rm -v /home/guglielmo/PROJECTS/provamicroros:/project --env MICROROS_LIBRARY_FOLDER=micro_ros_stm32cubemx_utils/microros_static_library_ide microros/micro_ros_static_library_builder:jazzy

jazzy: Pulling from microros/micro_ros_static_library_builder

Digest: sha256:1482f3df56184ecc5d4a9d45ad9be0a17a84a91fca947d07f20d1678b23f6243

Status: Image is up to date for microros/micro_ros_static_library_builder:jazzy

docker.io/microros/micro_ros_static_library_builder:jazzy

dos2unix: converting file /project/micro_ros_stm32cubemx_utils/microros_static_library_ide/library_generation/library_generation.sh to Unix format...

micro-ROS library found. Skipping...

Delete micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/ for rebuild.

 

arm-none-eabi-gcc -o "provamicroros.elf" @"objects.list" -lmicroros -mcpu=cortex-m7 -T"/home/guglielmo/PROJECTS/provamicroros/STM32F767ZITX_FLASH.ld" --specs=nosys.specs -Wl,-Map="provamicroros.map" -Wl,--gc-sections -static -L/home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/include --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

/home/guglielmo/st/stm32cubeide_1.19.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lmicroros: No such file or directory

collect2: error: ld returned 1 exit status

make[1]: *** [makefile:66: provamicroros.elf] Error 1

make: *** [makefile:59: all] Error 2

"make -j8 all" terminated with exit code 2. Build might be incomplete.

 

Can you help me or tell me if there's already a post like this I can consult?

1 ACCEPTED SOLUTION

Accepted Solutions
USER_RG
Associate II

I fixed the library link search path as
/home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros

 

and now build properly......

 

THANKS

View solution in original post

5 REPLIES 5
Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 


@USER_RG wrote:
/home/guglielmo/st/stm32cubeide_1.19.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lmicroros: No such file or directory

collect2: error: ld returned 1 exit status

So that's the linker saying it can't find microros - presumably that's a pre-built library?

Does that library actually exist in your project?

If it does, is it in a place where the Linker is searching?

You specify the Linker search path here:

AndrewNeil_0-1761998549168.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Pavel A.
Super User

So what is the path part of the libmicroros.a ?

-L/home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/include

The "include" at the end looks suspicious.

 

 

It should be a pre-built library. Could you help me verify this?

My linker search path is made as in the follow figure

USER_RG_2-1762074635055.png

libraries: microros

libraries search path: /home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros

note: My workspare is:

/home/guglielmo/PROJECTS/provamicroros

But the error indicates that it does not include something at the following link:

home/guglielmo/st/stm32cubeide_1.19.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.1.0.202410170702/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld

 

 

the path of libmicroros.a is 

/home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros

but not incluede  microrso....

USER_RG
Associate II

I fixed the library link search path as
/home/guglielmo/PROJECTS/provamicroros/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros

 

and now build properly......

 

THANKS