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.