我已经在/home/arafat/go/src/github.com/tensorflow/tensorflow/tensorflow/contrib/go中手动克隆了tensorflow(我正在开发的一个库)的go目录,您可以看看here。我已经对lib.go进行了更改,因为
// #cgo LDFLAGS: -ltensorflow
// #cgo CFLAGS: -I /home/arafat/go/src/github.com/tensorflow/tensorflow
// #cgo CXXFLAGS: -I /home/arafat/go/src/github.com/tensorflow/tensorflow -std=c++11但是我得到了一个错误
# github.com/tensorflow/tensorflow/tensorflow/contrib/go
In file included from go/src/github.com/tensorflow/tensorflow/tensorflow/contrib/go/tf_session_helper.cc:20:0:
go/src/github.com/tensorflow/tensorflow/tensorflow/contrib/go/tf_session_helper.h:22:49: fatal error: tensorflow/core/public/tensor_c_api.h: No such file or directory
#include "tensorflow/core/public/tensor_c_api.h"
^
compilation terminated.论“做”
go get github.com/tensorflow/tensorflow/tensorflow/contrib/go我不能理解为什么这不起作用。
发布于 2016-09-14 07:12:55
可能是包含路径的错误,一个tensorflow太多了?也许你应该这么做
// #cgo CFLAGS: -I /home/arafat/go/src/github.com/tensorflow或
#include "core/public/tensor_c_api.h"https://stackoverflow.com/questions/37761362
复制相似问题