keystone-engine / keystone

Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
http://www.keystone-engine.org
GNU General Public License v2.0
2.23k stars 449 forks source link

fail building in windows #224

Open JuanJMarques opened 8 years ago

JuanJMarques commented 8 years ago

I'm trying to build the Keystone DLL from windows with the following enviroment

CMake 3.6.0 Visual Studio Community 2015 - Version 14.0.25420.1

I'm running the nmake-dll.bat from Visual Studio command promt and cmake is on the system's path but when I run the script it ends with the following trace:

D:\Github\keystone\build>cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  14.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: D:/Github/keystone/build/CMakeFiles/CMakeTmp

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

        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f
  CMakeFiles\cmTC_a3ea3.dir\build.make /nologo -L
  CMakeFiles\cmTC_a3ea3.dir\build

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

        C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe
  @C:\Users\user\AppData\Local\Temp\nmFE01.tmp

  testCCompiler.c

  Linking C executable cmTC_a3ea3.exe

        "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
  --intdir=CMakeFiles\cmTC_a3ea3.dir --manifests -- "C:\Program
  Files\mingw-w64\x86_64-5.3.0-win32-sjlj-rt_v4-rev0\mingw64\bin\ld.exe"
  /nologo @CMakeFiles\cmTC_a3ea3.dir\objects1.rsp
  @C:\Users\user\AppData\Local\Temp\nmFF69.tmp

  LINK Pass 1 failed to run.

  NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' :
  return code '0xffffffff'

  Stop.

  NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
  14.0\VC\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!
See also "D:/Github/keystone/build/CMakeFiles/CMakeOutput.log".
See also "D:/Github/keystone/build/CMakeFiles/CMakeError.log".

D:\Github\keystone\build>nmake

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.

I've seen this related issue #3 but it didn't work for me.

Thanks for the help.

aquynh commented 8 years ago

Does it help if you compile the latest Github code (not v0.9)?

Otherwise, it is clear that your VS setup is broken, and this has nothing to do with Keystone. Lets wait to have some VS experts to join for more discussion.