cancel
Showing results for 
Search instead for 
Did you mean: 

getStorageStructure API function unresolved

FValm.1
Associate III

I was trying to use the getStorageStructure API function inside the example program which is supplied with STM32CubeProgrammer. The Visual studio solution I was trying to change, inserting the call to the getStorageStructure, is the STM32CubePrgAPI. I simply added these line code in the original file USB_Example.cpp:

storageStructure* storageinfo;

 At the beginning of the USB_Example() function...

	int ret = getStorageStructure(&storageinfo);

After entering the DFU mode and calling the getDeviceGeneralInf() function.

The problem is that when I build the solution then 2 unresolved external symbol was generated:

Severity Code Description Project File Line Suppression State

Error LNK2019 unresolved external symbol _getStorageStructure referenced in function "int __cdecl USB_Example(void)" (?USB_Example@@YAHXZ) STM32CubePrgAPI C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\api\project\Visual Studio\x86\STM32CubePrgAPI\USB_Example.obj 1

I don't know what I'm missing... Any help?

1 REPLY 1
Mipoter
Associate II

The problem is related to the .lib file, which does not contain any reference to the getStorageStructure function. That is why you are getting that LNK2019 error message.

I solved this problem by regenerating the .lib file.

Regards