Cannot set VC++ Directories in the Options dialog of Visual C++ Express Edition

Details:  The VC++ Directories page on the Options dialog does not have a list box for viewing and modifying the directories used during a build. Consequently, it is not possible to modify the build directories using the IDE UI.

Workaround: C++ Directories can be added, removed or changed by modifying the VCProjectEngine.dll.express.config file located in the .\vc\vcpackages subdirectory of the Visual C++ Express Edition install location in a text editor, saving the changes and restarting the Visual C++ Express Edition. Please make sure that you also delete the file "vccomponents.dat" located in the "%USERPROFILE%\Local Settings\Application Data\Microsoft\VCExpress\8.0" if it exists before restarting Visual C++ Express Edition.

Easier procedure to use the PSDK with VC2005 Express is:
1. Create a directory "PlatformSDK" under "%ProgramFiles%\Microsoft Visual Studio 8\VC"
2. Copy the "bin", "include" and "lib" directory from the PSDK-installation into this directory.




Answer this question

Cannot set VC++ Directories in the Options dialog of Visual C++ Express Edition

  • Dennis Cheng

    Wow, this is a pain in the neck...has anyone got a simpler solution

    Thanks!

  • Bill Richardson

    I also had the same problem.  I have not tried to manually specify "Additional Include Directories" though.  In fact, I'm not even sure where I would do that from.

  • arup08

    What Chaos said is easily the best way...

    Also, what I did is add a couple enviroment variables like VCINCLUDE and VCLIB, put it in before the default directories like

    $(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include

    i.e. make it like

    $(VCINCLUDE);$(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include

    In addition, I should point out that the config file to edit is VCProjectEngine.dll.express.config, not VCProjectEngine.dll.config...  and you need to close it, delete the VCComponents.dat file and then reopen it to see changes


  • zaoacila89

    I had no end of trouble with this - I had followed the publicised procedure about editing the .config file and deleting the .dat file, this made it work for the administrator account that I installed it under but not a user account. I was nearly about to give up and copy the include, lib and bin directories into the %programfiles%\Visual Studio 8\PlatformSDK when I did the following and it worked on my user account aswell:
    Run "All Programs\Microsoft Platform SDK for Windows Server 2003 SP1\Register PSDK Directories with Visual Studio" (as administrator). It runs an installer for a bit and then gives you a warning message about modifying the settings of visual studio, click OK. Then reboot, and it worked....


  • tun

    will there be a patch addressing this or should we just expect it to be fixed in the retail version

  • Kulwant Dhaliwal

    Hi cmenge!
    This post has been edited either by the author or a moderator in the Microsoft Forums: http://forums.microsoft.com Wow, this is a pain in the neck...has anyone got a simpler solution
    The easiest procedure to use the PSDK with VC2005 Express is:

    1. Create a directory "PlatformSDK" under "%ProgramFiles%\Microsoft Visual Studio 8\VC"
    2. Copy the "bin", "include" and "lib" directory from the PSDK-installation into this directory.

    Then you do not need to change any config file.

    Newest PSDK-ISO is available at:
    http://www.microsoft.com/downloads/details.aspx FamilyId=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92
    
    -- 
    Greetings
     Jochen
     
      My blog about Win32 and .NET
      http://blog.kalmbachnet.de/

  • Jeffrey van Gogh - MSFT

    Ok, that's the easiest way to add the PSDK.  Is there an easy way to do the DirectX SDK

  • Patrick Martineau

    The official thread on this is locked, so I started another.  Several files are mentioned here, your location should vary from mine, but should still be logical.

    An easier way to change your path, Lib directories, and Include directories under VS8 C++ Express Beta 2 is as follows:

    Close VS8 Express

    Edit this file:
    H:\Program Files\Microsoft Visual Studio 8\VC\vcpackages\VCProjectEngine.Dll.Express.Config

    In the Directory section change the lines to read as follows:

    Include="$(INCLUDE)"

    Library="$(LIB)"

    Path="$(PATH)"

    Delete this file:
    C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\VCExpress\8.0\VCComponents.dat

    Now you can set all directories through your Windows environment variables and they will affect VS8 Express, and you'll only have to do the stuff above once.  Normally you will want to re-boot after each change.

    To change your Environment variables in Windows XP:
    Control Panel -> System -> Advanced Tab -> Environment Variables button

    Note that there are TWO PATH ENTRIES.  I recommend combining your user variable path with your system variable path, then deleting your user variable path.  Keeping one path straight is easier than two.

    For ideas on what to set your path to, check out the following batch file:
    H:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat


  • Jerry Pan

    Further to previous, this actually didn't work. I created another project and it gave me the same error 'can't find windows.h'. It only worked the first time because I had added the psdk directory as an additional include directory to the project. But what I have now decided to do which I will share with people is to add this to the template project.
    Add a section like this
                <Tool
                    Name="VCCLCompilerTool"
                    Optimization="0"
                    AdditionalIncludeDirectories="c:\program files\microsoft platform sdk\include"
                    PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
                    MinimalRebuild="true"
                    BasicRuntimeChecks="3"
                    RuntimeLibrary="3"
                    UsePrecompiledHeader="2"
                    WarningLevel="3"
                    Detect64BitPortabilityProblems="true"
                    DebugInformationFormat="4"
                />

    to the debug configuration in the xml template file which is usually in
    C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\default.vcproj
    and a similar one to the release configuration.


  • Sergey Jmacov

    Boris,

    There are two config files in my .\vc\vcpackages directory: VCProjectEngine.dll.config and VCProjectEngine.dll.express.config. Editing either of them does not help solving the "directory" problem. That is, the compiler does not appear to recognize the changes as if it didn't read those files at all, even after the IDE is restarted (I tried with PlatformSDK & DirectX SDK). The only solution working for me was to create a subdirectory in .\vc called PlatformSDK and manually copy header/lib files there (hardcoded path ). I have to manually specify "Additional Include Directories" for every project in order to use DirectX at all.

    Thanks,

    - NK

  • danoliv

    I just wanted to mention that I also had problems using the PDSK. I used Brian Johnsons reciept to incorporate the PSDK with VC++ Express.

    I had no problems making win32 applications, but during compile libraries such as ComDlg32 was not included. I discoverd that in the file for standard system include files, stdafx.h, there is a #define WIN32_LEAN_AND_MEAN. This define excludes rarely-used stuff from Windows headers, among others; commdlg.h. Removing this define made it possible to utilize the psdk.


  • Art Vandolay Jr.

    I'm having this problem with the full VC++ 2005 beta 2 (not the Express version). A few days ago, the directories were listed correctly (using Tools -> Options -> Projects and Solutions -> VC++ Directories). Today, they are no longer listed. I have tried editing VC\vcpackages\VCProjectEngine.dll.config and deleting the VCComponents.dat file, but after restarting VS8 the directories are still not shown, and my edits to the .config file have not affected the search path.

    The only thing I have done that might have brought this on is that I deleted a directory that may have been in the executable files path. However, recreating the directory has had no effect, and in any case that directory did not appear in the .config file when I first opened it.

  • Michael Cochran

    Quoting myself two messages up :) -
    "In addition, I should point out that the config file to edit is VCProjectEngine.dll.express.config, not VCProjectEngine.dll.config...  and you need to close it, delete the VCComponents.dat file and then reopen it to see changes"

  • parblaster

    It's absolutely fixed in current versions. We don't usually ship patches for Betas either, that's what RTM is for :)

  • Cannot set VC++ Directories in the Options dialog of Visual C++ Express Edition