link error to build caffe in osx 10.9


Problem:

I strictly follow the instruction in http://caffe.berkeleyvision.org/ to install caffe on osx 10.9. However, I get stuck in the following link error.

Undefined symbols for architecture x86_64:
  "google::protobuf::MessageLite::ParseFromString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in compute_image_mean.o
  "leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)", referenced from:
      _main in compute_image_mean.o
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::ios_base::getloc() const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
      _main in compute_image_mean.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in compute_image_mean.o
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      _main in compute_image_mean.o
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in compute_image_mean.o
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)", referenced from:
      _main in compute_image_mean.o
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*) in compute_image_mean.o
  "std::__1::ctype<char>::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::locale::~locale()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
  "std::__1::ios_base::clear(unsigned int)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*) in compute_image_mean.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help me if anybody has any idea about it. Thanks a lot.


Solution:

Did you try the new updated recommendations for OSX 10.9? http://caffe.berkeleyvision.org/installation.html It basically means that you need to recompile protobuf with the libstdc++ compiler.

Recent Tips

  1. How to use CSS to give a circle a "partial border"
  2. BasicNetwork.performRequest: Unexpected response code 500 for http://192.168.1.195:85/tranxavApi/public/api/signup
  3. Laravel 5.1 Authentication without password
  4. django-bootstrap-v5 DecimalField Throwing Errors in ModelForm Class
  5. update and delete in realm xamarin
  6. Grabbing text between Processing Instructions in XSLT
  7. Foreign key refering to multiple tables
  8. Run a visual studio 2010 Windows7 project on a Windows XP machine
  9. How to apply groupname to HTML radio buttons in asp.net?
  10. What is the most stable modal dialog implementation across browsers to use from javascript for a web app?
  11. Move, Remove, and Replace information from Google Sheets with new entries using Google Script
  12. How can I get rid of jerkiness in WinForms scrolling animation?
  13. Update MySQL table column from another table entities
  14. Shoot fireball once in unity C#
  15. Adding a table of contents to a Microsoft Word Document using vbs
  16. Change locale in android app (onto Hindi)
  17. How do I stop selenium automation if 20% or 1st 20 test cases test methods are failed?
  18. Sharepoint with silverlight app
  19. What's the best way to write robots.txt for github pages using multiple repos?
  20. Biopython: Cant use .count() for biopython
  21. How can I find out the token balance of an address?
  22. ref value is undefined in vue (modal, textarea, $refs)
  23. Azure - HDInsight Hbase Data Insertion Failed
  24. SignalR overwriting OnConnected(), OnDisconnected()
  25. DatePickerDialog displays with two borders
  26. "type 'double' is not a subtype of type 'int' in type cast" error in flutter. What should i do?
  27. hiding the autocomplete list when user click outside the textbox is not working as expected
  28. JSF IceFaces basic problem with redisplaying input value
  29. How to validate material ui TextField in reactjs?
  30. Go and MongoDB connection won't work with panic log "no reachable server"