clinkerarmkeilcmox

Keil Linker Error L6002 with X-CUBE-CRYPTOLIB: Could not open file libSTM32Cryptographic_CM0_CM0PLUS.a : No such file or directory


I want to use the X-CUBE-CRYPTOLIB (CMOX) of my STM32 in Keil and installed it properly and selected my required modules. I can use the functions, header files etc. But if I want to compile, I am always getting the linker error saying it can't find the crypto lib even though I can 100% confirm the file is there.

..\file.axf: error: L6002U: Could not open file ..\STM32CubeExpansion_Crypto\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM0_CM0PLUS.a : No such file or directory

Even copying the file to several folders of the project doesn't work. I also tried to use an absolute path instead of relative but no difference (also because Keil seems to automatically turn it back into a relative path). I also tried linking the using the compiler flag --libpath [path to .a file] as the documentation suggests.

All in all it really seems like it just can't open the file for some reason. It might even be an internal linker error.


Solution

  • Thanks to  artless-noise-bye-due2AI for suggesting the the working solution in the comments.

    The solution was to extract the .a file using e.g. 7zip and import all extracted .o files into Keil.