glog: ./configure && make && make install fails with error: expected initializer before 'Demangle'

The error is below. I see the same problem referenced in https://github.com/google/glog/pull/7, though it’s not clear to me from the discussion whether this issue is fixed, and the instructions still direct users to use ./configure && make && make install.

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-demangle.lo -MD -MP -MF src/.deps/libglog_la-demangle.Tpo -c src/demangle.cc  -fPIC -DPIC -o src/.libs/libglog_la-demangle.o
In file included from src/demangle.cc:38:0:
src/demangle.h:80:27: error: expected initializer before 'Demangle'
 bool GOOGLE_GLOG_DLL_DECL Demangle(const char *mangled, char *out, int out_size);
                           ^

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 25

Most upvoted comments

I have been same error and I tried following command on Ubuntu 14.04. It did work. cd glog mkdir build && cd build export CXXFLAGS=“-fPIC” && cmake … && make VERBOSE=1 make sudo make install

It’s pretty embarrassing that pulling the latest on Debian 8.5 server doesn’t even build and is affected by a year old bug.

The workaround of @hyuce works well, but it cannot be the solution or the standard documentation (which mentions ./configure && make && make install) should be updated. Can’t a patch be made to CMakeLists.txt in order to fix this issue?

FYI - Pull down version 0.3.3 - builds and installs fine