Linking external .a file into project

I have a customer that wants to provide me with .a file for some confidential algorithm they want to run. I am tasked with implementing this into my firmware.

Using the links below I have been able to compile in the .a file along with its associated header file. I can even use the #include to include the header file. However, when I start to call functions from the header file, the ld.exe returns an undefined reference exception.

My file structure is below, as well as my CMakelists.txt. It appears that I have followed the links and the example for linking an external library perfectly. Can I get some support to what I am missing, or what I should try next?

Thanks

CMakeLists.txt:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

target_sources(app PRIVATE src/main.c)

###
set(insight_src_dir   ${CMAKE_CURRENT_SOURCE_DIR}/insight)

set(INSIGHT_LIB_DIR     ${insight_src_dir}/lib)
set(INSIGHT_INCLUDE_DIR ${insight_src_dir}/inc)

add_library(insight_lib STATIC IMPORTED GLOBAL)

set_target_properties(insight_lib PROPERTIES IMPORTED_LOCATION             ${INSIGHT_LIB_DIR}/insight.a)
set_target_properties(insight_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSIGHT_INCLUDE_DIR})

target_link_libraries(app PUBLIC insight_lib)
###

Here is my folder structure:

hello_world

  > build

  > insight

      - header.h

  > lib

      - library.a

  > src

      - main.c

  - CMakeLists.txt

  - prj.conf

Parents Reply Children
No Data
Related