LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

error: Undefined symbol '__imp__wsprintfA' referenced in "\...cvi2015\bin\msvc\cvistart.lib".

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

0 Kudos
Message 1 of 5
(1,740 Views)

Isn't wsprintf some obsolete Windows-only function ? Do you use it in your code ? Can you replace it simply with sprintf ?

0 Kudos
Message 2 of 5
(1,708 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(1,698 Views)

Hi ! Did you solved this problem? I have these errors too !!

0 Kudos
Message 4 of 5
(1,569 Views)

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.

Message 5 of 5
(1,157 Views)