C++: Compiling for x86 does not work - by telos1

Status : 

  Not Reproducible<br /><br />
		The product team could not reproduce this item with the description and steps provided.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


4
0
Sign in
to vote
ID 311806 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 11/22/2007 2:26:08 AM
Access Restriction Public

Description

I have just updated from Visual Studio 2005 to Visual Studio 2008. I have ported a small C++ static library project. When compiling for x64 everything works without any problems. Compiling for x86 (Win32) results into more than 2000 erros in the Microsoft header files.

For test purposes I have created a new empty library project. Here I have got the same errors.

I am using Vista x64.
Sign in to post a comment.
Posted by ryankit1 on 2/6/2010 at 12:36 PM
I had the same problem and N_Nguyen's solution did the trick. It was driving me crazy. What I didn't realize was that in VS you have to identify every folder that Include files could be in, not just the higher level folder. WinDDK\7000\inc wasn't good enough. When I added \api and especially \crt subfolders all the compile errors went away. I spent many hours of frustration and the solution is much appreciated!
Posted by RichieO on 12/4/2009 at 12:23 PM
Thanks N_Nguyen that worked.
Posted by codemaniac on 11/13/2008 at 12:29 PM
The problem is a mixture of header file between DDK and VC 2008

My solution:
- In VS 2008 project,
- In the "C/C++ -> Preprocessor" - Set ignore default standard library to YES
- In the "General->Additional Include Directories" specified
the DDK path "C:\WinDDK\6000\inc\api; C:\WinDDK\6000\inc\crt"
- compile and it work - Hope this help
Posted by qlawson on 3/14/2008 at 6:34 PM
I found that I was receiving these errors when pointing to the incorrect "sal.h" header file. Mine was pointing to the Windows Media Format 11 SDK version, but when I switched to the default Visual Studio version, the errors went away.
Posted by Micah Zoltu on 12/24/2007 at 3:59 AM
I'm having a similar problem using the WDK with VS2008 Express.

Steps to reproduce:
Install VS2008 Express.
Install WDK.
New Visual Studio Project...
Set include path on project to WinDDK\6001.17121\inc\api
In the project's primary .cpp file add the following two lines:
#include <windows.h>
#include "hidsdi.h"

Try to build, notice the errors.

On a somewhat related note, hidsdi.h does not properly include the necessary header files to build, you have to include windows.h (or perhaps some subset of that) in order to get it to compile but I have not seen this requirement documented anywhere.
Posted by ChadN on 11/30/2007 at 8:46 AM
Also I am building to the 2.0 Framework. Let me know if you need any other information.
Posted by ChadN on 11/30/2007 at 8:44 AM
I have the same problem when I convert my vs2005 c++ manged project to vs2008. The solution given below does not solve my problem. In my project I have a reference to a single C# project from my C++ manged project. I however am using Windows XP Professional.
Posted by Martin Moenks on 11/27/2007 at 1:14 AM
I had the same problem. After resetting all settings via "Tools - Import and Export Settings - Reset all settings" it is now working.
Posted by Microsoft on 11/26/2007 at 8:27 AM
Hi: I've tried to reproduce this problem and I cannot. I tried with both the x64 and x86 compilers and in each cases I could build a static library. If you have a fuller example of what is causing this problem please let us know.

Jonathan Caves
Visual C++ Compiler Team
Posted by Microsoft on 11/23/2007 at 2:03 AM
Thanks for your feedback. We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team
Posted by Microsoft on 11/23/2007 at 2:03 AM
Thanks for your feedback. We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team