I try to use niScope 4.1 in VS2015 (C++, Win7, 64bit), but I got error "niScope.lib(glu32.obj) : error LNK2001: unresolved external symbol _sprintf". The same code can be ran under VS2010.
Does anyone know how to solve it? Or, niScope cannot be used in VS2015?
Solved! Go to Solution.
The only version of NI-Scope compatible with LabVIEW (and, thus, VS, since it's built out of LabVIEW) is 15.0. I'm assuming you're building a custom device with NI-Scope. If this is the case, try rebuilding your custom device after upgrading to the lastest version of the NI-Scope driver.
Roohcifer, your not exactly correct there. The NI-SCOPE driver is built in C, and to provide LabVIEW support, we use Call Library Function Nodes to the niScope.dll. LabVIEW has nothing to do with this issue. For documenation for which versions of LabVIEW are supported by a specific version of the NI-SCOPE driver, see the readme.htm file on the NI-SCOPE driver downloads page: NI-SCOPE Drivers
The real problem is actually with Visual Studio 2015 and later.
We ship a static library, niScope.lib, that contains a reference to sprintf. Microsoft has made breaking changes to the C runtime in Visual Studio 2015; see https://msdn.microsoft.com/en-us/library/bb531344.aspx specifically the section "The printf and scanf family of functions are now defined inline."
We (R&D) have this problem documented and have an open bug report to address this issue. For tracking, its CAR 546023.
Sorry, I assumed VS was in reference to VeriStand, as opposed to Visual Studio. We see upgrade issues like this all the time with custom devices wrapping our MI drivers. Carry on 🙂
Your response makes SOOO much more sense now! Thanks for jumping in anyway!
Thanks for your info, Nathan.
I am using NI-Scope 4.1 now (not NI-SCOPE 15.1 Driver). Version 4.1 was released on 06-14-2013, which is 2.5 years ago. It only support VS2010 and VS2012. But Win10 and VS2015 are both released now. So, are you planning to upgrade it?
I hope I can use VS2015 with NI-Scope as it is better than VS2010.
We plan on fixing this issue, which is not only an issue with NI-SCOPE 4.1, but also our latest driver NI-SCOPE 15.1. The root cause is already known, as I stated above. Thus VS2015 will not work until the bug as documented is resolved. I do not have a timeline for when it will be resolved.
I have the same issue with niScope.lib from NI-SCOPE 15.1 and VS2015.
You say earlier this year you will fix this in new release. Have you planned to release this new version soon ?
I have a software is develop under VS2015 ans now I must release it . So without your new version version I can't..
Please let me know when the new version will be available.
Regards, Mr ANCHER.
Edit : I just check the latest release changelog 15.1.1 to see if the bug 546023 was fixed. Apparently not.
I would generally disapprove of hand-modifying software libraries that are installed by an official National Instruments installer, but you may be able to work around the issue by replacing the niScope.lib files that your program links against.
I have copies of niScope.lib which do not have any unresolved sprintf symbols. They are attached to this message as a zip file.
Again, use these niScope.lib files at your own risk. Confirm that you are using niScope_32.dll version 4.3.0f0:
I have validated that swapping these niScope.lib files out will resolve the error LNK2019: unresolved external symbol _sprintf when compiling an NI-SCOPE application in Visual Studio 2015. I have done no other testing on other ADEs, and suspect that the installation of these .lib files may cause LabWindows/CVI to stop working.
We should hopefully have this issue officially resolved in an upcoming NI-SCOPE release.