06-14-2022 02:40 AM
I am trying to Build CVI project.
but it always is gives this kind of error:
i tried reinstral the CVI software but its gives same errors.
{ error: Undefined symbol '__imp__wsprintfA' referenced in "e:\software\national instruments\cvi2015\bin\msvc\cvistart.lib". }
{ error: Undefined symbol '__imp__wsprintfA' referenced in "e:\software\national instruments\cvi2015\bin\msvc\cvistart.lib". }
i'm using the CVI 2015 & Windows 10
please give me a help. what was the error
06-15-2022 09:26 AM
Isn't wsprintf some obsolete Windows-only function ? Do you use it in your code ? Can you replace it simply with sprintf ?
06-16-2022 03:46 AM - edited 06-16-2022 03:48 AM
wsprintf() (really wsprintfA() and wsprintfW() under the hood) is a Windows API despite its name looking like a C Runtime function. It resides in user32.dll and you need to add the user32.lib import library to your project definitions in order for the compiler to be able to link the executable file. I wouldn't call it obsolete but if you intend to compile your source code ever for another platform than Windows it is indeed not a good idea to use it in your code.
The ANSI C equivalent (sort of) is swprintf() but I'm not sure the LabWindows CVI runtime library supports the wide character string C Runtime functions. If you want to compile it for multiplatform, things get a lot hairier (as often in C). The wide char functions got added much later and Microsoft did their own version of them before that and then later renamed them all with an underscore before the name to indicate that they are compiler specific implementations.
10-17-2022 10:05 AM
Hi ! Did you solved this problem? I have these errors too !!
04-21-2023 09:33 AM
Hi all,
Here is an article from NI, which is giving an exact solution for this issue. Try to go through this article to solve the error.
Regards)
_______
Best way to thank is to give Kudos / Mark as a solution.