LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in float.h after upgrade to LabWindows 5.5

After getting a new PC, I installed LabWindows 5.5. A project which has run sucessfully on previous versions now stops with a build error. The error is in the file C:\MeasurementStudio\cvi\include\ansi\float.h at the pragma line:

#ifdef WIN32
#pragma pack(pop)
#endif

The error says "float.h"(42,22) Pack pragma valid values are 1, 2, 4, 8, and 16."

I dont understand this. The project has been compiling with no similar errors for the past 3 yrs on the previous version.
0 Kudos
Message 1 of 7
(3,493 Views)
This is most likely being caused because you previously had the common compiler define /DWIN32_LEAN_AND_MEAN in your environment. If you go to Options->Compiler Defines in the Project Window and add /DWIN32_LEAN_AND_MEAN, this should go away. If you do an upgrade install, it keeps your compiler defines from the previous version, but on a fresh install it doesn't add this compiler define.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 7
(3,493 Views)
"If you go to Options->Compiler Defines in the Project Window and add /DWIN32_LEAN_AND_MEAN, this should go away."

I go to Options->Compiler Defines, and I see /DWIN32_LEAN_AND_MEAN in the little window. Does that mean that it is added to my project? If I click on Predefined Macros, I dont see it in that list.

Hey, maybe I should look this up in the documentation. In the User Manual. Pg 3-61, it refers to this define as /DWIN32_MEAN_AND_LEAN. Is this a misprint?Now I'm really confused! And Im still getting the error...
0 Kudos
Message 3 of 7
(3,493 Views)
What OS are you using? There is another compiler flag that should be in your predefines that may be missing called _PUSHPOP_SUPPORTED. It's possible that, based on your OS, this flag isn't there. If you don't see this flag under the Predefined macros, try adding /D_PUSHPOP_SUPPORTED=1 to the Compiler defines.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 4 of 7
(3,493 Views)
kmagas writes:
> After getting a new PC, I installed LabWindows 5.5. A project which
> has run sucessfully on previous versions now stops with a build error.
> The error is in the file C:\MeasurementStudio\cvi\include\ansi\float.h
> at the pragma line:
>
> #ifdef WIN32
> #pragma pack(pop)
> #endif
>
> The error says "float.h"(42,22) Pack pragma valid values are 1, 2,
> 4, 8, and 16."
>
> I dont understand this. The project has been compiling with no similar
> errors for the past 3 yrs on the previous version.

The pragma pack mechanism changed slightly from CVI 501
to CVI 55. Your program might redefine "pop" to some
numerical value that isn't supported inside the pack pragma.
To see if this is the case add the following line to your
pro
gram just before including float.h or before the
offending line:

#pragma message pop

Check the build error window to see if pop was redefined to
something else. You might have to change the order in which
you include files in your program, or #undef pop.

Hope this helps,

Peter

PS: FYI, the pack pragma changed from this:

#pragma pack(4)
....
#pragma pack()

To this:

#pragma pack(push)
#pragma pack(4)
....
#pragma pack(pop)

The old method should still work however.

-- Peter Ilberg
0 Kudos
Message 5 of 7
(3,493 Views)
Thanks for all the answers, but I am still very much in the dark.

I found no instance of "pop" in any of my project files.

I have no control over including float.h. Nowhere in my project files do I explicitly include float.h, but I do have float variables, so I can only assume that the CVI environment senses that it is needed and includes it.

I tried adding /D_PUSHPOP_SUPPORTED=1 to the compiler predefines, with no luck.

This new PC is the same OS as the old one, Windows 98 SE.
0 Kudos
Message 6 of 7
(3,493 Views)
kmagas writes:
> Thanks for all the answers, but I am still very much in the dark.
>
> I found no instance of "pop" in any of my project files.
>
> I have no control over including float.h. Nowhere in my project files
> do I explicitly include float.h, but I do have float variables, so I
> can only assume that the CVI environment senses that it is needed and
> includes it.
>
> I tried adding /D_PUSHPOP_SUPPORTED=1 to the compiler predefines, with
> no luck.
>
> This new PC is the same OS as the old one, Windows 98 SE.

As a workaround, you can copy the old float.h file from CVI
501 into your CVI 55 tree (cvi/include/ansi/float.h). The
only difference between the two files is the #pragma pack.
This should still work and you can continue
working on your
program.

If you have a little more time to investigate the problem, I
suggest you try this quick test if you haven't done so
already. Open float.h (from cvi/include/ansi/), search for
the line containing #pragma pack(pop) i.e. the one giving
you the error and add this line directly above it (inside
the #ifdef WIN32 block):

#pragma message pop

Recompile your project and verify that you have a Warning:
Message: in your Build Error Window for the line
that you've just added. If the warning message doesn't read
"pop" then it's been redefined to something else and you
need to find out where.

However, it is surprising that you haven't been able to find
pop anywhere in your project when you searched through your
project files. For one thing, it should've shown up in
float.h where it gives you the error. Or did I misunderstand
you?

Hope this helps,

Peter

-- Peter Ilberg
0 Kudos
Message 7 of 7
(3,493 Views)