Skip to content

undefined reference to Blowfish::Blowfish #17

Open
@zjbaby

Description

@zjbaby

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions