Sign In
Visual C++ Team Blog
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Share this
RSS for posts
Atom
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
Announcement
Bug Info
C++ language
C++/CLI
C++0x
Channel 9
Community
compiler
design
Dev
DirectX
GPU
Graphics
IDE
Intellisense
MFC
MSBuild
Parallelism
performance
STL
Test
VC++
VS2010
weekly roundup
Windows 7
Archive
Archives
June 2012
(1)
May 2012
(5)
April 2012
(6)
March 2012
(6)
February 2012
(8)
January 2012
(2)
December 2011
(1)
November 2011
(3)
October 2011
(6)
September 2011
(4)
August 2011
(2)
July 2011
(3)
June 2011
(14)
May 2011
(11)
April 2011
(11)
March 2011
(16)
February 2011
(12)
January 2011
(15)
December 2010
(7)
November 2010
(1)
October 2010
(1)
September 2010
(3)
August 2010
(3)
July 2010
(3)
June 2010
(5)
May 2010
(2)
April 2010
(6)
March 2010
(9)
February 2010
(5)
January 2010
(5)
December 2009
(2)
November 2009
(5)
October 2009
(5)
September 2009
(3)
August 2009
(3)
July 2009
(4)
June 2009
(8)
May 2009
(7)
April 2009
(3)
March 2009
(7)
February 2009
(3)
January 2009
(2)
December 2008
(6)
November 2008
(6)
October 2008
(5)
September 2008
(1)
August 2008
(5)
July 2008
(1)
June 2008
(5)
May 2008
(5)
April 2008
(8)
March 2008
(3)
February 2008
(5)
January 2008
(5)
December 2007
(5)
November 2007
(10)
October 2007
(8)
September 2007
(6)
August 2007
(5)
July 2007
(6)
June 2007
(5)
May 2007
(5)
April 2007
(7)
March 2007
(9)
February 2007
(5)
January 2007
(4)
December 2006
(6)
November 2006
(2)
October 2006
(5)
September 2006
(5)
August 2006
(6)
July 2006
(5)
June 2006
(10)
May 2006
(3)
Fixing "Unsatisfied forward declaration" error from MIDL
MSDN Blogs
>
Visual C++ Team Blog
>
Fixing "Unsatisfied forward declaration" error from MIDL
Fixing "Unsatisfied forward declaration" error from MIDL
vcblog
27 Jun 2007 1:04 PM
Comments
6
Earlier this week I was helping a customer port some code from Visual Studio 2005 to a beta build of Orcas when we noticed an interesting change of behavior in how the new version of midl.exe (from the Windows Vista SDK release) was parsing code. In case you run into the issue, here's a brief description, along with what we did to work around it:
In pseudo code, what the customer had looked like this:
#include “MyInterfaceDefn.idl”
interface MyInterface;
Which parsed fine with the midl.exe included in Visual Studio 2005. However, building with Orcas, the customer's code produced the following error:
MIDL2337 : unsatisfied forward declaration
and referenced the last line of code in the same scope as "i
nterface MyInterface;
".
It turns out the customer defined MyInterface in
MyInterfaceDefn.idl
and then put the declaration line right after the definition which, although worked fine in VS 2005, no longer is accepted by the new midl.exe. The solution turned out to be simple - just put the forward declaration before the definition and everything compiles fine:
interface MyInterface;
#include “MyInterfaceDefn.idl”
The customer's code built an ran without any problems. Unfortunately, this was just one of those kind of idiosyncratic pieces of code that worked ok under the old idl compiler, but when the Windows tools teams updated midl, no longer went through ok. Luckily, the solution is trivial once you arrive at it. Hopefully if you hit the same issue, this blog entry will put you on your merry way!
Ben Anderson
Visual C++ Libraries QA team
6 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...