close

How to build 64-bits application on WinXP-64 with AMD64 platform?
There are many discussion on the Internet, but seems not have a good one.

I had tried several methods, the following is the closest one, but still has some problems. I write it down for my memorandum.

  • My Hardware: AMD Athlon64 3000+, 1.81GHz, 512MB RAM
    GeForce MX440 with AGP8x
    GA-K8NSC-939
  • OS: Windows XP 64-bits Edition, 2003, Service Pack 1, v.1069
  • Compiler: VC++ 6.0 with SP5
  • SDK:
    • Windows DDK 3790.1830  (for Microsoft Windows Server 2003 SP1)
    • Platform SDK: PSDK-AMD64, 6.0.3734.0 (from Microsoft download)
  • Settings in MSDEV:
    • Tools->Options->Directories:
      • Executable File:
        %PSDK_DIR%/Bin/Win64/AMD64
        %PSDK_DIR%/Bin/Win64/X86/AMD64
      • Include Files:
        %PSDK_DIR%/Include/ATL
        %PSDK_DIR%/Include/MFC
        %PSDK_DIR%/Include/CRT
        %DDK_DIR%/Inc/CRT
        %DDK_DIR%/Inc/WNET
        %VC_DIR%/VC98/Include
      • Library Files:
        %PSDK_DIR%/Lib/AMD64
        %PSDK_DIR%/Lib/AMD64/ATLMFC
        %VC_DIR%/VC98/LIB

        Note 1: I have verified these path settings are the minimum requirement to build a Debug/Release version of project.
        Note 2: %PSDK_DIR% is the folder you installed the Platfoem SDK, so do %DDK_DIR% and %VC_DIR%. They are not represented as environment variables here.
  • Everytime you create a new project, you must modify the following settings:
    • Project->Settings->C/C++
      • Category: General->Debug info: don't select Program Database for Edit and Continue
      • Category: Code Generation->Use run-time library: select (Debug) Multi-Threaded DLL
      • Remove /Gz, /Gm, /GX items in the Project Options box.
    • Project->Settings->Link
      • Add /machine AMD64 to the Project Options box.
      • Remove /pdbtype:sept in the Project Options box.
  • To run the application, you have to copy some DLLs to the application folder or system32 folder.
    • Debug version: copy the dlls in %PSDK_DIR%NoRedistWin64AMD64.
    • Release version: copy the dlls in %PSDK_DIR%redistWin64AMD64.

The above settings just make your project pass compiling and linking. The Release version can execute normally, but the Debug version shows nothing, it hangs and shows nothing. You cannot even trace into the source code because it said no debug info. Probably there are problems in the Debug version of MFC DLLs.

For some configurations, the link fails and shows unresolved _security_cookie, I don't know how to solve it.

The 32-bits application can directly run (on WoW64). They said Visual Studio 2005 (beta) will do the job much easier. The developing environment for 64-bit application is amateur, therefore, I won't spend time in trying this again.


   


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 free6d1823 的頭像
    free6d1823

    Free Software

    free6d1823 發表在 痞客邦 留言(0) 人氣()