Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help.
_Do not post such requests to Issues._ Doing so interferes with the development of Caffe.
Please read the guidelines for contributing before submitting this issue.
Compile error when using gcc-4.8.4
If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.
The error is as following:
/usr/include/boost/property_tree/detail/json_parser_read.hpp: In constructor ‘boost::property_tree::json_parser::json_grammar<Ptree>::definition<Scanner>::definition(const boost::property_tree::json_parser::json_grammar<Ptree>&)’:
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
escape
^
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
make: *** [.build_release/cuda/src/caffe/layers/detection_output_layer.o] 错误 1
make: *** 正在等待未完成的任务....
I found some solutions which said I should change compiler to at least gcc-5.3. But when I changed to gcc-5.4, there are much more incredible errors, most of them shows "undefined reference [未定义的引用]" like
.build_release/lib/libcaffe.so:对‘cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)’未定义的引用
.build_release/lib/libcaffe.so:对‘google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)’未定义的引用
collect2: 错误:ld 返回 1
It have tried all kinds of ways that I can think of, but none works.
Look forward to your help~
I also tried an old version of caffe, it works amazingly. So can I use ssd in that built caffe? What should I do? In fact I am not familiar with caffe, very thanks for the help.
Operating system: Ubuntu 14.04
Compiler: gcc-4.8.4(also tried gcc-5.4.0)
CUDA version (if applicable): CUDA 8
CUDNN version (if applicable): None
BLAS: OpenBLAS-0.2.14
Python or MATLAB version (for pycaffe and matcaffe respectively): Python 2.7.6
Finally I found it's caused by boost, not gcc.
I didn't install boost completely. Since I compiled boost manually, after it finished there were still some targets unsuccessfully, but I didn't notice it. The unsuccessful items were because of the lack of bzip. So when I installed bzip, and recompile boost, things worked out.
Most helpful comment
Finally I found it's caused by boost, not gcc.
I didn't install boost completely. Since I compiled boost manually, after it finished there were still some targets unsuccessfully, but I didn't notice it. The unsuccessful items were because of the lack of bzip. So when I installed bzip, and recompile boost, things worked out.