frcnn icon indicating copy to clipboard operation
frcnn copied to clipboard

undefined reference to `Blowfish::Blowfish`

Open zjbaby opened this issue 4 years ago • 1 comments

Hi, I compile follow the steps:

  1. cd $CAFFE_ROOT
  2. cp Makefile.config.example Makefile.config
  3. uncomment the line: USE_CUDNN := 1
  4. comment the *_20 and *_21 lines
  5. make -j7

and I get errors like that: .build_release/tools/encrypt_model.o: In function main': encrypt_model.cpp:(.text.startup+0x79): undefined reference to Blowfish::Blowfish(std::vector<char, std::allocator > const&)' encrypt_model.cpp:(.text.startup+0xbd): undefined reference to Blowfish::Decrypt(char const*, char const*)' encrypt_model.cpp:(.text.startup+0x113): undefined reference to Blowfish::Encrypt(char const*, char const*)' collect2: error: ld returned 1 exit status Makefile:711: recipe for target '.build_release/tools/encrypt_model.bin' failed make: *** [.build_release/tools/encrypt_model.bin] Error 1 make: *** Waiting for unfinished jobs.... .build_release/tools/convert_imageset.o: In function main': convert_imageset.cpp:(.text.startup+0xf2a): undefined reference to caffe::ReadImageToDatum(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int, int, int, int, bool, std.::build_release__cxx11/:tools:/basic_string<convert_annoset.ochar:, Instd :function: char_traits<mainchar'>:, convert_annoset.cppstd::(:.allocatortext.startup<+char0x9f9>) :> undefinedconst &reference, tocaffe ::caffeDatum::)LabelMap': :~LabelMap()' convert_annoset.cpp:(.text.startup+0xc00): undefined reference to caffe::AnnotatedDatum::AnnotatedDatum()' convert_annoset.cppcollect2: error: ld returned 1 exit status :(.text.startup+0xd6f): undefined reference to caffe::AnnotatedDatum::~AnnotatedDatum()' convert_annoset.cpp:(.text.startup+0xebd): undefined reference to caffe::LabelMap::LabelMap()' convert_annoset.cpp:(.text.startup+0xeea): undefined reference to caffe::MapNameToLabel(caffe::LabelMap const&, bool, std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, int> > >)' convert_annoset.cpp:(.text.startup+0x12df): undefined reference to caffe::ReadImageToDatum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, int, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&Makefile:711: recipe for target '.build_release/tools/convert_imageset.bin' failed , caffemake: *** [.build_release/tools/convert_imageset.bin] Error 1 ::Datum*)' convert_annoset.cpp:(.text.startup+0x1ec5): undefined reference to caffe::ReadRichImageToAnnotatedDatum(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int, int, int, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, caffe::AnnotatedDatum_AnnotationType, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, int> > > const&, caffe::AnnotatedDatum*)' convert_annoset.cpp:(.text.startup+0x2364): undefined reference to caffe::AnnotatedDatum::~AnnotatedDatum()' convert_annoset.cpp:(.text.startup+0x2436): undefined reference to caffe::LabelMap::~LabelMap()' collect2: error: ld returned 1 exit status Makefile:711: recipe for target '.build_release/tools/convert_annoset.bin' failed make: *** [.build_release/tools/convert_annoset.bin] Error 1 .build_release/tools/extract_features.o: In function int feature_extraction_pipeline<float>(int, char**)': extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x1d3): undefined reference to caffe::Net::CopyTrainedLayersFrom(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' collect2: error: ld returned 1 exit status Makefile:711: recipe for target '.build_release/tools/extract_features.bin' failed make: *** [.build_release/tools/extract_features.bin] Error 1 .build_release/tools/convert_annoset_r.o: In function main': convert_annoset_r.cpp:(.text.startup+0x9f9): undefined reference to caffe::LabelMap::~LabelMap()' convert_annoset_r.cpp:(.text.startup+0xc00): undefined reference to caffe::AnnotatedDatumR::AnnotatedDatumR()' convert_annoset_r.cpp:(.text.startup+0xd6f): undefined reference to caffe::AnnotatedDatumR::~AnnotatedDatumR()' convert_annoset_r.cpp:(.text.startup+0xeba): undefined reference to caffe::LabelMap::LabelMap()' convert_annoset_r.cpp:(.text.startup+0x159f): undefined reference to caffe::ReadImageToDatum(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int, int, int, int, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, caffe::Datum*)' convert_annoset_r.cpp:(.text.startup+0x21d1): undefined reference to caffe::ReadRichImageToAnnotatedDatumR(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::AnnotatedDatumR_AnnotationType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int> > > const&, caffe::AnnotatedDatumR*)' convert_annoset_r.cpp:(.text.startup+0x2634): undefined reference to caffe::AnnotatedDatumR::~AnnotatedDatumR()' convert_annoset_r.cpp:(.text.startup+0x26e2): undefined reference to caffe::LabelMap::~LabelMap()' collect2: error: ld returned 1 exit status .build_release/tools/caffe.o: In function CopyLayers(caffe::Solver*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)': caffe.cpp:(.text+0x69d): undefined reference to caffe::Net<float>::CopyTrainedLayersFrom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' caffe.cpp:(.text+0x727): undefined reference to caffe::Net::CopyTrainedLayersFrom(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' .build_release/toolsMakefile:711: recipe for target '.build_release/tools/convert_annoset_r.bin' failed /make: *** [.build_release/tools/convert_annoset_r.bin] Error 1 caffe.o: In function test()': caffe.cpp:(.text+0x16e9): undefined reference to caffe::Net::CopyTrainedLayersFrom(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' collect2: error: ld returned 1 exit status Makefile:711: recipe for target '.build_release/tools/caffe.bin' failed make: *** [.build_release/tools/caffe.bin] Error 1

Why and how to fix it?

zjbaby avatar Oct 13 '20 01:10 zjbaby

@zjbaby I can't directly think of what the problem is, it may be related to your compilation environment.Make a clean copy and try again later.

makefile avatar Oct 14 '20 09:10 makefile