Thread: Compiling x64 code in VC++ 6.0?

  1. #1
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545

    Compiling x64 code in VC++ 6.0?

    Hi,
    I know VC++ 6.0 came out way before x64, but is it even remotely possible to compile an x64 DLL on VC++ 6.0?
    All our projects are for VC++ 6.0 and somehow a developer (who left the company) managed to compile an x64 DLL. I'm wondering how he did it? Some other developers say he used a .mak file rather than the .dsp & GUI; and in the .mak file I do see "_M_AMD64" defined, but surely that by itself couldn't allow VC++ 6.0 to create an x64 DLL?
    Is it possible he may have just used a newer VC++ to compile the .mak file and have it still be binarily compatible with the other 6.0 binaries?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    If you install Windows SDK (the latest version compatible with VC6 is February 2003) - you will get the possibility to select Win64 as target
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by vart View Post
    If you install Windows SDK (the latest version compatible with VC6 is February 2003) - you will get the possibility to select Win64 as target
    But how is that even possible with VC++ 6.0? Doesn't it need to know about the new Rxx registers, 8-byte pointers...? Or is it good enough just to link against 64-bit libraries?

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by cpjust View Post
    But how is that even possible with VC++ 6.0? Doesn't it need to know about the new Rxx registers, 8-byte pointers...? Or is it good enough just to link against 64-bit libraries?
    SDK provides updated compiler - it is a reason you have to place its bin directory before the VC6 native bin directory
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    OK, now this is strange...

    I ran:
    Code:
    SetEnv.cmd /X64 /RETAIL
    in the Platform SDK directory, then when I run NMAKE on my .mak file I get this error:
    Code:
    tempfile.bat
    Access is denied.
            0 file(s) copied.
    The system cannot find the file specified.
    NMAKE : fatal error U1077: 'tempfile.bat' : return code '0x1'
    What in the world is tempfile.bat and why is it looking for it?

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Just a random guess: have you tried using "nmake -v" to see what nmake thinks it should be doing?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by matsp View Post
    Just a random guess: have you tried using "nmake -v" to see what nmake thinks it should be doing?

    --
    Mats
    You mean NMAKE /N /F project.mak ALL?
    That gives me:
    Code:
    tempfile.bat
    del tempfile.bat
    EDIT: nevermind. It wasn't building anything because I already had a previous x86 build sitting in the Release directory. Doh!
    Last edited by cpjust; 07-29-2008 at 09:33 AM.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I must confess it was a long time since I used nmake, and I though it was more similar to the gnu/generic make that I've used more recently.

    My nmake (from vc6) says that it's got a /Y to "Disable batch mode". Perhaps that will help?

    Or perhaps /D to "display build information, or /P "display nmake information".

    Sorry if this is not very useful....

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with compiling code with option -O2
    By koushikyou in forum C Programming
    Replies: 16
    Last Post: 01-07-2009, 06:03 AM
  2. makefile exported by vc 6.0 doesn't work
    By wow in forum Windows Programming
    Replies: 7
    Last Post: 03-24-2006, 04:20 PM
  3. Porting code from VC++6 to VC .NET??
    By dug in forum C++ Programming
    Replies: 10
    Last Post: 01-31-2005, 11:42 AM
  4. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  5. VC 6.0 compiled error
    By alan4100 in forum Windows Programming
    Replies: 4
    Last Post: 09-17-2001, 03:10 PM