使用env_time.cc:19:10构建Tensorflow iOS:致命错误:' windows.h'文件未找到

时间:2017-05-02 17:19:59

标签: c++ ios makefile tensorflow

我试图在El Capitan上构建Tensorflow iOS并遇到很多错误。我已按照https://github.com/tensorflow/tensorflow/pull/3382/fileshttps://github.com/tensorflow/tensorflow/pull/2936/files#r67559693中的更改进行操作,直到我在运行tensorflow/contrib/makefile/build_all_ios.sh时遇到此错误:

gcc --std=c++11 -I. -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/ -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/eigen -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/ -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/include -I/usr/local/include -c tensorflow/core/platform/windows/env_time.cc -o /Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/tensorflow/core/platform/windows/env_time.o
tensorflow/core/platform/windows/env_time.cc:19:10: fatal error: 'windows.h' file not
      found
#include <windows.h>
         ^
1 error generated.
make: *** [/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/tensorflow/core/platform/windows/env_time.o] Error 1
+ '[' 2 -ne 0 ']'
+ echo 'armv7 compilation failed.'
armv7 compilation failed.
+ exit 1

有谁知道怎么通过那个?我假设它正在尝试在Mac上构建Windows。

1 个答案:

答案 0 :(得分:0)

我只是通过删除所有内容来解决问题,并从头开始使用以下内容:

brew install bazel
brew install automake
brew install autoconf
brew uninstall libtool && brew install libtool
git clone https://github.com/tensorflow/tensorflow
tensorflow/contrib/makefile/download_dependencies.sh
tensorflow/contrib/makefile/build_all_ios.sh