.comment-link {margin-left:.6em;}
The purpose of life...
Saturday, June 07, 2008
 
Windows driver development - Compilation...

If you are getting the error

fatal error C1007: unrecognized flag '-typedil' in 'p2'
LINK : fatal error LNK1257: code generation failed

or

fatal error C1007: unrecognized flag '-typedil' in 'p2'
LINK : fatal error LNK1257: code generation failed


The issue I have found is that you are using the cl.exe version 14 and link.exe version 8 from the WinDDK folder.

Prepened the VC 9.0\bin to the PATH variable to point to the cl.exe v 15.00 & link.exe v.9.0. The VC 9.0\bin has the x86 compiler, and the VC 9.0\bin\x86_x64 for the compiler for the x86 machine for the adm64 target.

Hope this helps.
 
Comments:
I've actually experienced this with a static *.lib compiled with VS2008 while the consumer of the *.lib was compiled in VS2005. I was able to work-around this by creating a second version of the *.lib, compiled in VS2005. It is sort of a pain, but necessary imo.

Thanks for the info though, the mention of different compiler versions got my "thinkin cap" sparkin with activity.
 
Check to make sure you don't have "whole program optimization" -> "optimize at link time" turned on in your 2008 library. I just got around this issue by turning it off.
 
What is meant by:

Prepened the VC 9.0\bin to the PATH variable to point to the cl.exe v 15.00 & link.exe v.9.0. The VC 9.0\bin has the x86 compiler, and the VC 9.0\bin\x86_x64 for the compiler for the x86 machine for the adm64 target.

How do i do that ?
 
My problem was that I had VS8 and VS9 open at the same time. Closed VS8 and it built.
 
Don't use Whole program optimization when you build static library in Visual Studio 2008. This means under project properties Configuration Properties-> C/C++ -> Optimization choose No for "Whole Program Optimization"

Junaid Khan, PhD
 
I, of course, a newcomer to this blog, but the author does not agree
 
Post a Comment



<< Home
Life, love, and the quest for nirvana...

Name:
Location: Ames, Iowa, United States

Class:
Software Generalist

Major Skills:
Programming: 50 +26
Debugging: 50 +30
C++: 50 +20
C#: 30 +10

ARCHIVES
10/06/2002 - 10/13/2002 / 12/15/2002 - 12/22/2002 / 08/15/2004 - 08/22/2004 / 02/26/2006 - 03/05/2006 / 03/05/2006 - 03/12/2006 / 03/12/2006 - 03/19/2006 / 10/07/2007 - 10/14/2007 / 06/01/2008 - 06/08/2008 / 09/21/2008 - 09/28/2008 / 07/05/2009 - 07/12/2009 /


Powered by Blogger