cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles with linking custom application arm-ostl-linux-gnueabi-gcc for STM32MP157x-DK2

btank
Associate II

Hi, I tried the Hello World application on Cortex-A7, I want to try linking my custom application library in this example. Can I do that?

I changed the print_hello function and calling another function from my custom library.

I tried linking custom library in Makefile by

LDFLAGS += $(shell pkg-config --libs gtk+-3.0) -lxxxxx.a

The library file is in the same folder. But Get the below error:

 

arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi -o gtk_hello_world gtk_hello_world.c -O2 -pipe -g -feliminate-unused-debug-types -Wall -pthread 
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/gtk-3.0 -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/gio-unix-2.0
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/pango-1.0 -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/harfbuzz
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/pango-1.0 -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/fribidi
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/harfbuzz -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/atk-1.0
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/cairo -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/pixman-1
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/freetype2 -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/gdk-pixbuf-2.0
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/libpng16 -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/libmount
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/blkid -I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/glib-2.0
-I/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/glib-2.0/include -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmasq_bn_util_qtp-cortex-a7.a
/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/12.2.0/ld: cannot find : No such file or directory
/home/usr-x/STM32MPU_workspace/Developer-Package/SDK/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/12.2.0/ld: cannot find -lmasq_bn_util_qtp-cortex-a7.a: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:13: gtk_hello_world] Error 1


 What is wrong here? How can I link library?

Can we not use GTK demo launcher?

I want to run simple C application on cortexA7.

Any help is highly appreciated. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

Hello @btank ,
Can you try to precise explicitly so path of your library by adding this :

LDFLAGS += $(shell pkg-config --libs gtk+-3.0) -L<absolute_path_of_lib> -lxxxxx.a

If still not working and if possible, can you provide a little bit more information about your Makefile, your project structure ?

Kind regards,
Erwan 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Erwan SZYMANSKI
ST Employee

Hello @btank ,
Can you try to precise explicitly so path of your library by adding this :

LDFLAGS += $(shell pkg-config --libs gtk+-3.0) -L<absolute_path_of_lib> -lxxxxx.a

If still not working and if possible, can you provide a little bit more information about your Makefile, your project structure ?

Kind regards,
Erwan 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.