Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Traditional NI-DAQ libraries return warning when compiled

I am using traditional NI-DAQ 7.1 libraries with Visual studio C++ and PCI-6527 board. the project using the board had Level 4 warnings set and it consideres warnings as erra as well.
When I compile my source on Level 3 warning level, everything works fine, but when I use default Level 4 warning level, my application returns following error:
'warning C4201: nonstandard extension used : nameless struct/union'
This error appears about five times and is linked to MMSystem.h header file. Erra appear in lines: 1837, 1841, 1862 and 1866.
Does anybody know why this warning appears?
0 Kudos
Message 1 of 2
(3,064 Views)
The Microsoft C++ compiler has a non-standard extension that allows you to declare a structure with no name as member of another structure or union. MMSystem.h takes advantage of this compiler extension.

When you compile under warning level 4, the compiler warns you when you use a non-standard extension. When you use the feature that treats warnings as errors, you get an error when you use a non-standard extension.

MMSystem.h is a header file for a Microsoft-supplied library, so if you want to find out if they plan to make MMSystem.h compilable under the settings you are using, you will need to take it up with them. One option is to post to the MSDN newsgroups.

If you want to work around this problem
, you could turn off this particular warning before you include MMSystem.h and turn the warning back on after you include MMSystem.h. This looks like the following:
#pragma warning (push)
#pragma warning(disable:4201)
#include "mmsystem.h"
#pragma warning (pop)
0 Kudos
Message 2 of 2
(3,064 Views)