[vtkusers] Windows 64 bits compilation with Visual Studio .net 2003

Laurent Peters laurent.peters at telemis.com
Mon Oct 6 06:20:51 EDT 2008


When I try to generate the nmake build, CMake (2.6) reports the following
error:

LINK : warning LNK4012: invalid value 'x64', must be 'AM33, AMD64, ARM,
CEE, EBC, IA64, M32R, MIPS, MIPS16, IPSFPU, MIPSFPU16, MIPSR41XX, SH4,  SH5,
THUMB, or X86'; option ignored


Here is the complete log:

-- The C compiler identification is MSVC
-- The CXX compiler identification is MSVC
-- Check for working C compiler: C:/Program Files/Microsoft Platform SDK for
Windows Server 2003 R2/
Bin/win64/x86/AMD64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Platform SDK for
Windows Server 2003 R2/
Bin/win64/x86/AMD64/cl.exe -- broken
CMake Error at C:/Program Files (x86)/CMake
2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32
(MESSAGE):
  The C compiler "C:/Program Files/Microsoft Platform SDK for Windows Server
  2003 R2/Bin/win64/x86/AMD64/cl.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/Program Files (x86)/CMake 2.6/CMakeFiles/CMakeTmp



  Run Build Command:nmake /NOLOGO "cmTryCompileExec\fast"

        nmake -f CMakeFiles\cmTryCompileExec.dir\build.make /nologo -L
  CMakeFiles\cmTryCompileExec.dir\build

        "C:\Program Files (x86)\CMake 2.6\bin\cmake.exe" -E
cmake_progress_report
  "C:\Program Files (x86)\CMake 2.6\CMakeFiles\CMakeTmp\CMakeFiles" 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

        C:\PROGRA~1\MI9547~1\Bin\win64\x86\AMD64\cl.exe
  @C:\Users\lp\AppData\Local\Temp\nm7C35.tmp

  testCCompiler.c

  Linking C executable cmTryCompileExec.exe

        "C:\Program Files (x86)\CMake 2.6\bin\cmake.exe" -E vs_link_exe
  C:\PROGRA~1\MI9547~1\Bin\win64\x86\AMD64\cl.exe /nologo
  @CMakeFiles\cmTryCompileExec.dir\objects.rsp
  @C:\Users\lp\AppData\Local\Temp\nm7CA3.tmp

  LINK : warning LNK4012: invalid value 'x64', must be 'AM33, AMD64, ARM,
  CEE, EBC, IA64, M32R, MIPS, MIPS16, MIPSFPU, MIPSFPU16, MIPSR41XX, SH4,
  SH5, THUMB, or X86'; option ignored

  LINK : warning LNK4068: /MACHINE not specified; defaulting to X86

  CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj : fatal error LNK1112:
  module machine type 'AMD64' conflicts with target machine type 'X86'

  LINK Pass 1 failed.  with 2

  NMAKE : fatal error U1081: 'C:\Windows\system32\cmd.exe' : program not
  found

  Stop.

  NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Platform SDK for
  Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'

  Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:5 (PROJECT)


-- Configuring incomplete, errors occurred!


On Fri, Oct 3, 2008 at 5:21 PM, David Partyka <dave.partyka at kitware.com>wrote:

>  You could probably generate an nmake build and then use the platform SDK
> to compile 64bit from the command line. You wouldn't be able to use VS2003
> to debug your 64 bit build though. If you want to use the IDE to debug I
> think the simplest thing would be to upgrade to either VS 2005 or VS 2008
> which has built in 64bit support.
>
>
>
> *From:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On
> Behalf Of *Laurent Peters
> *Sent:* Friday, October 03, 2008 11:12 AM
> *To:* vtkusers at vtk.org
> *Subject:* [vtkusers] Windows 64 bits compilation with Visual Studio .net
> 2003
>
>
>
> I usually compile my code for 64 bits Windows using Microsoft Visual Studio
> .net 2003 and Microsoft Platform SDK for Windows Server 2003.
> I tried to compile VTK 5.2 for 64 bits Windows with the same tools.
>
> Compilation fails because CMake automatically adds the flag /MACHINE:I386
> to the linker options,
> which conflicts with the /MACHINE:amd64 flag that I specified in CMake.
>
> Is there a way to avoid that CMake adds this /MACHINE:I386 flag? I did not
> find one.
> Do I need to upgrade to the latest version of Microsoft Visual Studio, for
> which 64 bits compilation of VTK seems straightforward?
> Are there some instructions available to compile with these tools?
>
> Thanks,
> Laurent
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081006/0e0323cb/attachment.htm>


More information about the vtkusers mailing list