Reputation: 1080
I am trying to compile file which have GFLAGS inside. My compiling command :
g++ -I ../eigen-eigen-b9cd8366d4e8/ -I/caffe_path/distribute/include my_file.cpp -std=c++0x -lpthread -lglog -lboost_system -DUSE_OPENCV
My error message is:
/usr/bin/ld: /tmp/ccv5GAaZ.o: undefined reference to symbol '_ZN6google26ShowUsageWithFlagsRestrictEPKcS1_'
//usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line
It is my first time working with Gflags. Based on the suggestion on internet i tried to comment lines with#ifndef
and #endif
in the following lines but it did not help.
#ifndef GFLAGS_GFLAGS_H_
namespace gflags = google;
#endif
I also tried suggestions on this thread , but it did not fix anything.
Upvotes: 1
Views: 626
Reputation: 1080
The gflags installed inside the caffe and seperately were somehow causing conflict. Uninstalling any of them did not help. Solution for me was uninstallation (all) of the whole caffe and gflags (internals and externals) solved the problem. When I was sure that there is no trace of gflags/glogs and caffe on my system I was able to install caffe again.
Upvotes: 1