LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ShObjIdl.h "Empty declaration" warning with CVI 9.0

Solved!
Go to solution

Just installed CVI 9.0 and now my project generates an "Empty declaration" warning in ShObjIdl.h at line 1330

 

I'm including shlobj.h to support the use of SHGetFolderPath(), and shlobj.h in turn includes ShObjIdl.h

 

I believe I have the same compiler options as before with 8.5.1.  I note there is a new SDK version with CVI 9 which likely factors into the explanation.

 

Is this any cause for concern?

 

--Ian

0 Kudos
Message 1 of 8
(5,863 Views)

I confirmed that the warning does show up because of the following:

 

typedef enum tagSHCONTF
{
    ... // actual values omitted for brevity

};

 

The typedef is an empty declaration because it does not actually declare any new typename. You're correct that this is new to the updated SDK shipped in CVI 9.0. The previous version of shlobj.h did not include ShObjIdl.h. I confirmed that the same typename ommission exists in the ShObjIdl.h installed by the Windows SDK provided by Microsoft.

 

I do not see any reason to worry about this warning.

 

Mert A.

National Instruments

0 Kudos
Message 2 of 8
(5,843 Views)

Thanks, Mert. 

 

If you have any clever ideas on how to suppress just this warning (better than inserting a bogus typename into that read-only file), I'd appreciate it. I'd rather not see this every time I compile.

 

--Ian

0 Kudos
Message 3 of 8
(5,815 Views)

Honestly, your best bet is probably to just temporarily make that file writable and throw some new typename after that enum.

 

But I do have another suggestion that allows you to leave the file alone. You can create a #define that essentially removes the typedef from the enum tagSHCONTF declaration by attributing it to a new, preceeding dummy enum declaration:

 

typedef enum shcontf_dummy { shcontf_dummy } shcontf_dummy_typedef; enum tagSHCONTF
#include <shlobj.h>

 

After the replacement, this becomes:

 

typedef enum shcontf_dummy { shcontf_dummy } shcontf_dummy_typedef;

enum tagSHCONTF
{

...

};

 

If you go this route, you'll have to add this to each source file that you include shlobj.h from.

 

Mert A.

National Instruments

0 Kudos
Message 4 of 8
(5,802 Views)

Mert A. wrote: 

But I do have another suggestion that allows you to leave the file alone. You can create a #define that essentially removes the typedef from the enum tagSHCONTF declaration by attributing it to a new, preceeding dummy enum declaration:


I added the line

typedef enum shcontf_dummy { shcontf_dummy } shcontf_dummy_typedef; enum tagSHCONTF

(copy/paste from your post) just before the

#include <shlobj.h>

but now I have some compilation errors

  • "cvidef.h"(201,17) Unknown enumeration 'tagSHCONTF'
  • "cvidef.h"(201,35) Invalid use of 'struct'


Where is my mistake?


Using CVI 2009

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 8
(5,376 Views)
Solution
Accepted by Ian.W

Whoops. It looks like I made a copy/paste error in that post, and Ian never called me out on it. As I said, you have to add a #define, not a typedef:

 

#define tagSHCONTF shcontf_dummy { shcontf_dummy } shcontf_dummy_typedef; enum tagSHCONTF
#include <shlobj.h>

 

Sorry about that.

 

Mert A.

National Instruments

Message 6 of 8
(5,360 Views)
Thanks a lot.
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 7 of 8
(5,340 Views)

"Ian never called me out on it" .... guilty as charged! Time pressure forced me to hack that read-only file and I never posted back. Thanks, Vix (& Mert!) for bringing this thread to a proper conclusion.

 

--Ian

0 Kudos
Message 8 of 8
(5,330 Views)