编译caffe导致使用google名称空间的未定义引用
我的代码有问题,因为gflags导致了错误。所以我决定手动使用gflags存储库和链接,这似乎是个坏主意。现在我甚至不能编译caffe 在执行以下命令时编译caffe导致使用google名称空间的未定义引用,caffe,gflags,Caffe,Gflags,我的代码有问题,因为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
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> >*)'
.build\u release/tools/convert\u imageset.o:在函数“\u GLOBAL\u sub\u I\u convert\u imageset.cpp”中:
convert_imageset.cpp:(.text.startup+0x74):对“google::FlagRegisterer::FlagRegisterer(char const*,char const*,char const*,bool*,bool*)”的未定义引用
convert_imageset.cpp:(.text.startup+0xa3):对“google::FlagRegisterer::FlagRegisterer(char-const*、char-const*、char-const*、bool*、bool*)”的未定义引用
convert_imageset.cpp:(.text.startup+0x117):未定义对“google::FlagRegisterer::FlagRegisterer(char-const*,char-const*,char-const*,std::uuucx11::basic_string*,std:uuuuucx11::basic_string*)”的引用
我在互联网上寻找一些git线程和其他线程中可能的解决方案。没用。我们将非常感谢您提供的任何帮助或建议。下载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