CMake Build Issues with Undefined References in NXP SDK Project

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CMake Build Issues with Undefined References in NXP SDK Project

1,243件の閲覧回数
shreyaschandran
Contributor I

Hello,

I am working on an NXP-based project and facing an issue with the CMake build. While compiling the project, I am getting multiple undefined reference errors during the linking process for functions such as nLog, sss_key_object_init, and ex_sss_boot_se05x_open. These errors suggest that the linker cannot find the implementations of these functions.

Here are some relevant details about my setup:

  1. CMake Configuration: I am using CMake for managing the build process, and I've included the necessary dependencies using the include_libraries directive in the CMakeLists.txt file. However, despite these dependencies being correctly included, the linker is unable to resolve references to certain functions.

  2. Missing Symbols: The undefined references are related to functions from the NXP SDK (likely nLog, sss_key_object_init, and ex_sss_boot_se05x_open).

  3. CMakeLists.txt: I have verified that the required libraries are linked in the target_link_libraries section of the CMakeLists.txt, but the issue persists. The libraries appear to be missing at link time.

Steps I Have Taken:

  • Ensured that the necessary dependencies are included using include_libraries in CMakeLists.txt.

  • Verified that the relevant source files and libraries are linked in target_link_libraries.

  • Checked that the function implementations are present in the linked libraries and headers.

  • Cleaned and rebuilt the project multiple times, but the issue still persists.

Questions:

  1. Are there any specific steps I might have missed in configuring the dependencies or linking the libraries in the CMakeLists.txt?

  2. Could this be related to a misconfigured library or incorrect order of library linkage?

  3. Are there any other possible reasons why these functions are not being linked correctly?

I would appreciate any help or guidance on how to resolve this issue.

Thanks in advance!

0 件の賞賛
返信
4 返答(返信)

1,130件の閲覧回数
Armin1
Contributor I
Just a side note: I have seen this issue with libs using c++ when libs are using another toolchain than the lib user.
Try with a matching toolchain (gcc vs. clang), google for -stdlib=libc++ for details.
0 件の賞賛
返信

1,227件の閲覧回数
Veronika_techsupport
NXP TechSupport
NXP TechSupport

Hello @shreyaschandran 

could you please share what NXP part number you are using?

Thank you

0 件の賞賛
返信

1,226件の閲覧回数
shreyaschandran
Contributor I
I am using the SE050 secure element from NXP, specifically with the Plug & Trust middleware package (v04.05.01) on an STM32MP1 platform.
0 件の賞賛
返信

1,220件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @shreyaschandran ,

 

Actually we have little experience on STM32MP1 porting, but for such linking issue, most likely it is due to the libs including the functions were not built successfully so the linker could not find the them during linking stage, but the libs do work well with NXP SDK, so maybe there is still some porting issues here when you change NXP SDK to STM SDK,  please kindly contact ST for further support on this.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

0 件の賞賛
返信