本代码是基予caffe的linux的, 安装好caffe之后需要编译GOTURN代码,在编译过程中会出现如下错误:
fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
解决方法:
用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
thomas@thomas-All-Series:~/GOTURN-master/build$ protoc --cpp_out=/home/thomas/GOTURN-master/caffe-master/include/caffe/ caffe.proto
之后在
/home/thomas/GOTURN-master/caffe-master/include/caffe目录下新建文件夹,命名为proto,然后把编译出来的caffe.pb.h和caffe.pb.cc放进去
之后,错误消失。
附:如出现以下错误:
libcudart.so.7.5: cannot open shared object file: No such file or directory
解决方法:
64-bit:sudo ldconfig /usr/local/cuda/lib64
参考:使用caffe时编译出错
include and lib
使用自己机器编译的include和lib (caffe/build/lib, caffe/include)
caffe.pb.h丢失问题:
/home/wuliwei/caffe/include/caffe/blob.hpp:9:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
解决方法: 用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
wuliwei@wulw:~/caffe/src/caffe/proto$ protoc --cpp_out=/home/wuliwei/caffe/include/caffe/ caffe.proto
stdc++
linker error:
/usr/bin/ld: caffe_cnn_handler.o: undefined reference to symbol '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
是找不到libstdc++.so.6,解决方法是在Makefile中加入:
LIBS += -L/usr/lib/x86_64-linux-gnu -lstdc++