【问题标题】:Compiling caffe causing undefined references with google namespace使用 google 命名空间编译 caffe 导致未定义的引用
【发布时间】:2017-06-09 09:24:01
【问题描述】:

我的代码有问题,由于 gflags 而导致错误。所以我决定手动使用 gflags 存储库和链接,这似乎是个坏主意。现在连caffe都编译不了了。

在执行以下命令时

make all -j $(($(nproc) + 1))

我收到以下错误消息。

.build_release/tools/convert_imageset.o: In function `_GLOBAL__sub_I_convert_imageset.cpp':
convert_imageset.cpp:(.text.startup+0x74): undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
convert_imageset.cpp:(.text.startup+0xa3): undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
convert_imageset.cpp:(.text.startup+0x117): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'

我在互联网上查看了一些 git 线程和其他一些 threads 中的一些可能的解决方案。没有任何工作。任何形式的帮助或建议都将受到高度赞赏。

【问题讨论】:

    标签: caffe gflags


    【解决方案1】:

    通过下载 gflags 包并手动安装即可解决问题。使用以下命令:

    $ tar xzf gflags-$version-source.tar.gz
    $ cd gflags-$version
    $ mkdir build && cd build
    $ ccmake ..
    
      - Press 'c' to configure the build system and 'e' to ignore warnings.
      - Set CMAKE_INSTALL_PREFIX and other CMake variables and options.
      - Continue pressing 'c' until the option 'g' is available.
      - Then press 'g' to generate the configuration files for GNU Make.
    
    $ sudo make -j4
    $ sudo make test    -j4 
    $ sudo make install -j4
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-17
      • 2016-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-22
      • 1970-01-01
      相关资源
      最近更新 更多