Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Not Reproducible Help for as Not Reproducible


4
0
Sign in
to vote
Type: Bug
ID: 311806
Opened: 11/22/2007 2:26:08 AM
Access Restriction: Public
3
Workaround(s)
view
4
User(s) can reproduce this bug

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.
Details
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 Micah71381 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
Sign in to post a workaround.
Posted by bobtheturtle on 3/7/2010 at 6:30 PM
Add "C:\Program Files\Microsoft Visual Studio 9.0\VC\include\sal.h" to C/C++ | Advanced | Force Includes to force the VC++ sal.h to be included before any other sal.h
Posted by TonyKent on 5/5/2009 at 6:50 AM
I have encountered same error as i included some headers from ddk7000. The problem happens because of sal.h.

Workaround: just remove sal.h file from your Winddk dir (on my machine - C:\WinDDK\7000.0.winmain_win7beta.081212-1400\inc\api). Preprocessor will include sal.h from your WindowsSDK. That's it.
Posted by Sergey Shandar citylizard on 4/17/2008 at 7:25 PM
Add "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" to "Additional Include Directories" before other directories which also contain the 'sal.h' file.