::gflags’ has not been declared (gflas installed correctly)

1,171 views
Skip to first unread message

Sarah Ershadi Nasab

unread,
Nov 21, 2014, 6:39:44 AM11/21/14
to caffe...@googlegroups.com
Hi am using ubuntu 12.04 LTS and caffe_master

I've installed all pre-required libraries recently for making caffe .
but still I have  a problem with make all command ;
--------------------------------------
src/caffe/common.cpp: In function ‘void caffe::GlobalInit(int*, char***)’:
src/caffe/common.cpp:35:5: error: ‘::gflags’ has not been declared
make: *** [.build_release/src/caffe/common.o] Error 1
----------------------------------------------

I insttaled at first gflag and secounldly I trie to install glog . This was a known bog . I tried to solve this by the steps That are in the bellow link .
http://stackoverflow.com/questions/23534181/error-when-compiling-glog

I did all step corectly and I think now I have glog and gflag installed correctly on my laptop.
but still make all command has problem with golog .

What should I do about this kind of error ?

Thanks a lot in advance .
Sarah

Diego Rueda

unread,
Nov 24, 2014, 8:54:51 AM11/24/14
to caffe...@googlegroups.com
I remember i had to change all ::gflags to ::google in common.cpp and others to "Make" successfully.

Factor Chen

unread,
Apr 23, 2015, 11:34:33 PM4/23/15
to caffe...@googlegroups.com
At the beginning, when I installed caffe, I met the error like this "relocation R_X86_64_32S against `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' can not be used when making a shared object; recompile with -fPIC",

so I recompile  the gflags like this,

CXXFLAGS="-fPIC" cmake .. -DGFLAGS_NAMESPACE=google

then I met the error like you, "‘::gflags’ has not been declared"

so I remove the google and recompile  the gflags again like this,

CXXFLAGS="-fPIC" cmake ..

finally I got the right result.


在 2014年11月21日星期五 UTC+8下午7:39:44,Sarah Ershadi Nasab写道:
Reply all
Reply to author
Forward
0 new messages