locked
VS2010 Express and missing x64 compiler

    Question

  • Hello,

    i have successfully used VS2008 Express together with the 64 Bit compiler (installed from a SDK long time ago).

    Now i have installed VS2010 (on same machine). Looking through the (start) menu i don't find a DOS box to open a 64 bit environment with VS2010.

    I also can't find a vcvars64.bat in VS2010 directories.

    I searched for a SDK, which is suitable for VS2010, but was not successful to find one.

    Windows SDK for Windows 7

    (e.g. from http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505)

    mentions only VS2008, is it also useable for VS2010 ?

    Best regards,

        Martin

     

    Tuesday, May 11, 2010 6:28 AM

Answers

  • Hi Martin,

    Thank you for your reply.

    Based on your description, it seems that Visual Studio 64-bit tools are not installed on your machine with Visual C++ 2010 Express Edition.

    Is the 64 bit compiler delivered with VS2010, or do i need an additional SDK (which ?) ?

    The answer is yes. I have installed Visual Studio 2010 Ultimate with "Full install" on my machine. I can find "Visual Studio Command Prompt (2010)", "Visual Studio Itanium Cross Tools Command Prompt (2010)", "Visual Studio x64 Cross Tools Command Prompt (2010)" and "Visual Studio x64 Win64 Command Prompt (2010)" via Start menu >> Microsoft Visual Studio 2010 >> Visual Studio Tools.
    For "Microsoft Visual Studio 2010 Express" folder, I can only find "Visual Studio Command Prompt (2010)".
    By default, Visual C++ Express Edition only installs x86 tools.

    Moreover, as far as I know, there is a new SDK for 64-Bit Visual C++ Toolset released several days ago. You can download it from http://blogs.msdn.com/windowssdk/archive/2010/05/21/Released_3A00_-Windows-SDK-for-Windows-7-and-.NET-Framework-4.aspx.

    Hope this helps! If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, May 26, 2010 1:50 AM
    Monday, May 24, 2010 3:10 AM

All replies

  • Hi Martin,

    Thank you for your post.

    Some clarification with you:
    Have you installed Visual C++ 2010 Express Edition on your machine?

    I have installed Visual C++ 2010 Express on my machine. When I navigate to Start menu, I can find "Visual Studio Command Prompt (2010)" under "Microsoft Visual Studio 2010 Express" folder.
    I also can find vcvarsall.bat file via the path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC.

    Could you please help me to check whether you can find it?

    If you cannot find them, could you please try to remove Visual C++ 2010 Express and reinstall it again?

    Hope this helps! If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Tuesday, May 18, 2010 1:48 AM
    • Unmarked as answer by Maurer Martin Friday, May 21, 2010 3:30 PM
    Wednesday, May 12, 2010 2:52 AM
  • Hello,

    many thanks for your answer. When i start the "Vistual Studio Command Prompt (2010), i can call vcvarsall.bat, but x64 is not working:

     

    Setting environment for using Microsoft Visual Studio 2010 x86 tools.

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>vcvarsall x32
    Error in script usage. The correct usage is:
        vcvarsall [option]
    where [option] is: x86 | ia64 | amd64 | x86_amd64 | x86_ia64

    For example:
        vcvarsall x86_ia64

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>vcvarsall x86
    Setting environment for using Microsoft Visual Studio 2010 x86 tools.

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>vcvarsall x64
    The specified configuration type is missing.  The tools for the
    configuration might not be installed.

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>

    It tells me "The specified configuration type is missing.  The tools for the configuration might not be installed."

    Therefore back to my initial question: Is the 64 bit compiler delivered with VS2010, or do i need an additional SDK (which ?) ?

     

    Best regards,

        Martin

    PS: Alert was not working, there sorry for my late response...

     

    Friday, May 21, 2010 3:34 PM
  • Hi Martin,

    Thank you for your reply.

    Based on your description, it seems that Visual Studio 64-bit tools are not installed on your machine with Visual C++ 2010 Express Edition.

    Is the 64 bit compiler delivered with VS2010, or do i need an additional SDK (which ?) ?

    The answer is yes. I have installed Visual Studio 2010 Ultimate with "Full install" on my machine. I can find "Visual Studio Command Prompt (2010)", "Visual Studio Itanium Cross Tools Command Prompt (2010)", "Visual Studio x64 Cross Tools Command Prompt (2010)" and "Visual Studio x64 Win64 Command Prompt (2010)" via Start menu >> Microsoft Visual Studio 2010 >> Visual Studio Tools.
    For "Microsoft Visual Studio 2010 Express" folder, I can only find "Visual Studio Command Prompt (2010)".
    By default, Visual C++ Express Edition only installs x86 tools.

    Moreover, as far as I know, there is a new SDK for 64-Bit Visual C++ Toolset released several days ago. You can download it from http://blogs.msdn.com/windowssdk/archive/2010/05/21/Released_3A00_-Windows-SDK-for-Windows-7-and-.NET-Framework-4.aspx.

    Hope this helps! If you have any concern, please feel free to let me know.

    Best regards,
    Yichun Chen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by YiChun Chen Wednesday, May 26, 2010 1:50 AM
    Monday, May 24, 2010 3:10 AM
  • Hello,

    I have the same problem as the original poster.

    >> Hope this helps! If you have any concern, please feel free to let me know.

    No, it doesn't help at all!

    The problem is simple (and two-fold)...

    The OP and me are talking about the SDK you are referring to http://blogs.msdn.com/windowssdk/archive/2010/05/21/Released_3A00_-Windows-SDK-for-Windows-7-and-.NET-Framework-4.aspx .

    I've done full installs of both the 32 and 64 bit SDK.

    There is a first problem with C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat. The script is wrong in the sense that it cannot find the directory C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools and reports this as an error and exits.

    Then in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat, a number of other (than the above one) batch files are referenced:

     

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat : LINE 18:

    :amd64
    if not exist "%~dp0bin\amd64\vcvars64.bat" goto missing
    call "%~dp0bin\amd64\vcvars64.bat"
    goto :eof

    :ia64
    if not exist "%~dp0bin\ia64\vcvars64.bat" goto missing
    call "%~dp0bin\ia64\vcvars64.bat"
    goto :eof

    :x86_amd64
    if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
    call "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"
    goto :eof

    :x86_ia64
    if not exist "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat" goto missing
    call "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat"
    goto :eof

     

    Please check before answering!

    NON OF THE FOUR ABOVE MENTIONED BATCH FILES EXIST IN THE ABOVE LOCATIONS IN THE SDK (7.1) DISTRIBUTIONS THAT ARE CURRENTLY UP FOR DOWNLOAD!

    They are missing and therefore the batch file goes to missing and exists with an error!

     

    Thanks in advance for investigating.

     

    Jim

     

     

     

     

     

    Wednesday, June 23, 2010 10:25 AM
  • It is straightforward to set up the environment for (a) compiler, (b) target OS version, and (c) CPU ISA, using the setenv.cmd tool supplied with the SDK (in its Bin directory). I've switched away from using vcvars*.bat to using this since it allows all three of those to be set cleanly and clearly in a single command line.

    See http://go.microsoft.com/fwlink/?LinkID=186826 for details.

    So long vcvarsx86_amd64.bat, long live SetEnv.Cmd.

    Tuesday, June 29, 2010 7:42 PM
  • I use setenv.cmd to get Microsoft Visual C++ Express 2010 to compile and link 64-bit C-code, in Windows 7 Home Premium 64-bit. I do it from the Command Prompt, without entering the IDE more than one initial time. (I do not have any use for the IDE for debugging my C-programs.) These are the steps.

    Download "Microsoft Visual Studio 2010 Express".

    Download "Microsoft SDKs\Windows\v7.1".

    In "All programs", go to

    Microsoft Visual Studio 2010 Express / Visual Studio Command Prompt (2010)

    Type the command "path > C:\MyCprogs\temp1.txt" (or use some other convenient text file).

    exit

    Open an ordinary Command Prompt, ie not from Visual Studio

    Type "path > C:\MyCprogs\temp2.txt".

    Identify the set of folders which are in temp1.txt and not in temp2.txt. These folders have to be appended to the path in the Command Prompt, with one modification, namely:

    change "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A" to "C:\Program Files\Microsoft SDKs\Windows\v7.1"

    Make a CMD-file in the folder where the Command Prompt starts (in my case C:\Users\S) which appends the right folders and calls setenv.

    Namely, with "folder1;folder2;...;folderN" standing for the set to be appended, the CMD-file is the following BC.Cmd (BC for Begin C)

    BC.Cmd
    ------
    @echo off
    PATH=folder1;folder2;...;folderN;%PATH%
    path=C:\MyCprogs;%PATH%
    set arg1=x64
    if (%1)==(32) set arg1=x86
    if (%1)==(ia64) set arg1=ia64
    call setenv /Release /%arg1%
    CD C:\MyCprogs

    After typing Bc at the Command Prompt, all is in order for 64-bit Compile, Link and Lib.

    CMD-files to compile and link, in C:\MyCprogs, after creating folder C:\MyCprogs\Release\. They reflect my particular preferences.

    Cc.Cmd
    --------
    @echo off
    if (%1) == () echo Give C-program with main() exclusive of extent .c.
    if (%1) == () GOTO END
    set arg2=%1
    if not (%2) == () set arg2=%2
    copy %1.c dummy.c
    cl.exe "C:\MyCprogs\dummy.c" /DVcexpr /DVcexpr64 /Fp"Release\dummy.pch" /Fo"Release/" /Fd"Release\vc100.pdb" /Gy /GL /I"C:\MyCprogs\CHEAD" /O2t /bigobj /c /errorReport:none /J /nologo /TC /WL /fp:precise
    link.exe /ERRORREPORT:NONE /FORCE:MULTIPLE /INCREMENTAL:NO /LARGEADDRESSAWARE /LTCG /MACHINE:X64 /NOLOGO /OPT:REF /OUT:"Release/dummy.EXE" /PDB:"Release/dummy.PDB" /SUBSYSTEM:CONSOLE .\Release\dummy.obj user32.lib .\SRLIB.LIB
    copy Release\dummy.exe %arg2%.Exe
    :END

    Cf.Cmd
    --------
    @echo off
    if (%1) == () echo Give C-function, not main(), in C:\MyCprogs\CFUNC\ exclusive of extent .c.
    if (%1) == () GOTO END
    cl.exe "C:\MyCprogs\CFUNC\%1.c" /DVcexpr /DVcexpr64 /Fp"Release\dummy.pch" /Fo"Release/" /Fd"Release\vc100.pdb" /Gy /GL /I"C:\MyCprogs\CHEAD" /O2t /bigobj /c /errorReport:none /J /nologo /TC /WL /fp:precise
    call Lb %1 %2

    Lb.Cmd
    --------
    @ECHO OFF
    if not "%2" == "" goto makenew
    LIB.EXE /ERRORREPORT:NONE /LTCG /MACHINE:X64 /SUBSYSTEM:CONSOLE /NOLOGO C:\MyCprogs\SRLIB.LIB C:\MyCprogs\Release\%1.OBJ
    goto END
    :makenew
    LIB.EXE /ERRORREPORT:NONE /LTCG /MACHINE:X64 /SUBSYSTEM:CONSOLE /NOLOGO /OUT:C:\MyCprogs\SRLIB.LIB C:\MyCprogs\Release\%1.OBJ
    :END

    The C-code made in this way with Express is the same as with Professional.

    A feature of code generatated by this C-compiler/linker is that getc(),fgetc() and putc(),fputc() for character I/O are extremely slow. Therefore I replace them with functions that read/write characters from/to a buffer which is read/written from/to file in its entirety with fread()/fwrite() when empty/full. In addition, for output the buffer is written to file at close. Then I/O is just as fast as code generatated by the MSVC 2006 Optimizing Compiler.


    Stig Rosenlund
    Saturday, June 11, 2011 10:04 PM